summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/SSAUpdater.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad2011-03-301-5/+4
| | | | | | PHINode::Create() giving the (known or expected) number of operands. llvm-svn: 128537
* fix PR9017, a bug where we'd assert when promoting in unreachableChris Lattner2011-01-241-0/+3
| | | | | | code. llvm-svn: 124100
* Generalize LoadAndStorePromoter a bit and switch LICMChris Lattner2011-01-151-16/+25
| | | | | | to use it. llvm-svn: 123501
* Add a new LoadAndStorePromoter class, which implements the generalChris Lattner2011-01-141-0/+154
| | | | | | | "promote a bunch of load and stores" logic, allowing the code to be shared and reused. llvm-svn: 123456
* Have a few places that want to simplify phi nodes use SimplifyInstructionDuncan Sands2010-11-161-2/+3
| | | | | | rather than calling hasConstantValue. No intended functionality change. llvm-svn: 119352
* Reapply commit 112699, speculatively reverted by echristo, sinceDuncan Sands2010-09-021-13/+11
| | | | | | | | | I'm sure it is harmless. Original commit message: If PrototypeValue is erased in the middle of using the SSAUpdator then the SSAUpdator may access freed memory. Instead, simply pass in the type and name explicitly, which is all that was used anyway. llvm-svn: 112810
* Speculatively revert 112699 and 112702, they seem to be causingEric Christopher2010-09-011-11/+13
| | | | | | self host errors on clang-x86-64. llvm-svn: 112719
* If PrototypeValue is erased in the middle of using the SSAUpdatorDuncan Sands2010-09-011-13/+11
| | | | | | | then the SSAUpdator may access freed memory. Instead, simply pass in the type and name explicitly, which is all that was used anyway. llvm-svn: 112699
* implement SSAUpdater::RewriteUseAfterInsertions, a helpful form of RewriteUse.Chris Lattner2010-08-291-0/+16
| | | | llvm-svn: 112409
* Combine the implementations of the core part of the SSAUpdater andBob Wilson2010-05-041-429/+102
| | | | | | MachineSSAUpdater to avoid duplicating all the code. llvm-svn: 103060
* Fix a performance problem with the new SSAUpdater. This showed up in theBob Wilson2010-04-211-2/+8
| | | | | | GCCAS time for MultiSource/Benchmarks/ASCI_Purple/SMG2000. llvm-svn: 102009
* Re-commit my previous SSAUpdater changes. The previous version naively triedBob Wilson2010-04-171-179/+434
| | | | | | | | | | | to determine where to place PHIs by iteratively comparing reaching definitions at each block. That was just plain wrong. This version now computes the dominator tree within the subset of the CFG where PHIs may need to be placed, and then places the PHIs in the iterated dominance frontier of each definition. The rest of the patch is mostly the same, with a few more performance improvements added in. llvm-svn: 101612
* Revert all my SSAUpdater patches. The PHI placement algorithm is not correctBob Wilson2010-04-031-315/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (what was I thinking?) and there's also a problem with LCSSA. I'll try again later with fixes. --- Reverse-merging r100263 into '.': U lib/Transforms/Utils/SSAUpdater.cpp --- Reverse-merging r100177 into '.': G lib/Transforms/Utils/SSAUpdater.cpp --- Reverse-merging r100148 into '.': G lib/Transforms/Utils/SSAUpdater.cpp --- Reverse-merging r100147 into '.': U include/llvm/Transforms/Utils/SSAUpdater.h G lib/Transforms/Utils/SSAUpdater.cpp --- Reverse-merging r100131 into '.': G include/llvm/Transforms/Utils/SSAUpdater.h G lib/Transforms/Utils/SSAUpdater.cpp --- Reverse-merging r100130 into '.': G lib/Transforms/Utils/SSAUpdater.cpp --- Reverse-merging r100126 into '.': G include/llvm/Transforms/Utils/SSAUpdater.h G lib/Transforms/Utils/SSAUpdater.cpp --- Reverse-merging r100050 into '.': D test/Transforms/GVN/2010-03-31-RedundantPHIs.ll --- Reverse-merging r100047 into '.': G include/llvm/Transforms/Utils/SSAUpdater.h G lib/Transforms/Utils/SSAUpdater.cpp llvm-svn: 100264
* Add a DEBUG_TYPE for the SSAUpdater.Bob Wilson2010-04-031-0/+1
| | | | llvm-svn: 100263
* Recommit 100158 now that the buildbots are happy again.Bob Wilson2010-04-021-21/+29
| | | | llvm-svn: 100177
* Revert 100158 in case it is causing some of the buildbot problems.Bob Wilson2010-04-021-29/+21
| | | | llvm-svn: 100164
* Check for terminating conditions before adding PHIs to the worklists.Bob Wilson2010-04-021-21/+29
| | | | | | This is more efficient than adding them to the worklist and then ignoring them. llvm-svn: 100158
* Remove trailing whitespace.Bob Wilson2010-04-011-5/+5
| | | | llvm-svn: 100148
* Rewrite another SSAUpdater function to avoid recursion.Bob Wilson2010-04-011-32/+46
| | | | llvm-svn: 100147
* Change another SSAUpdater function to avoid recursion.Bob Wilson2010-04-011-18/+24
| | | | llvm-svn: 100131
* Simplify the code to check for existing PHIs, now that it is only used inBob Wilson2010-04-011-30/+12
| | | | | | one place. This removes the template function added in svn 94690. llvm-svn: 100130
* The SSAUpdater should avoid recursive traversals of the CFG, since that mayBob Wilson2010-04-011-15/+23
| | | | | | blow out the stack for really big functions. Start by fixing an easy case. llvm-svn: 100126
* Rewrite part of the SSAUpdater to be more careful about inserting redundantBob Wilson2010-03-311-150/+263
| | | | | | | | PHIs. The previous algorithm was unable to reliably detect when existing PHIs in a cycle can be reused. I'm still working on reducing a testcase. Radar 7711900. llvm-svn: 100047
* Avoid creating redundant PHIs in SSAUpdater::GetValueInMiddleOfBlock.Bob Wilson2010-01-271-41/+75
| | | | | | | This was already being done in SSAUpdater::GetValueAtEndOfBlock so I've just changed SSAUpdater to check for existing PHIs in both places. llvm-svn: 94690
* Change errs() to dbgs().David Greene2010-01-051-2/+2
| | | | llvm-svn: 92603
* improve indentation avoid a pointless conversion from weakvh to trackingvh,Chris Lattner2009-12-211-3/+3
| | | | | | no functionality change. llvm-svn: 91848
* fix PR5837 by having SSAUpdate reuse phi nodes for theChris Lattner2009-12-211-1/+23
| | | | | | | | | | 'GetValueInMiddleOfBlock' case, instead of inserting duplicates. A similar fix is almost certainly needed by the machine-level SSAUpdate implementation. llvm-svn: 91820
* add an assert to make it really clear what this is doing. Return singularval asChris Lattner2009-12-041-1/+5
| | | | | | a compile time perf optimization to avoid a load. llvm-svn: 90507
* alternate fix for PR5258 which avoids worklist problems, with reduced testcase.Chris Lattner2009-10-201-11/+6
| | | | llvm-svn: 84667
* Fix PR5258, jump-threading creating invalid PHIs.Torok Edwin2009-10-201-2/+10
| | | | | | | When an incoming value for a PHI is updated, we must also updated all other incoming values for the same BB to match, otherwise we create invalid PHIs. llvm-svn: 84638
* Strip trailing white space.Duncan Sands2009-10-161-33/+31
| | | | llvm-svn: 84256
* add a simple helper method.Chris Lattner2009-10-101-0/+6
| | | | llvm-svn: 83745
* add ability for clients of SSAUpdater to find out about theChris Lattner2009-10-101-1/+9
| | | | | | PHI nodes inserted. llvm-svn: 83744
* add the ability to get a rewritten value from the middle of a block,Chris Lattner2009-10-101-3/+92
| | | | | | | not just at the end. Add a big comment explaining when this could be useful (which never happens for jump threading). llvm-svn: 83741
* rename GetValueInBlock -> GetValueAtEndOfBlock to better reflect Chris Lattner2009-10-101-11/+11
| | | | | | what it does. llvm-svn: 83740
* use a typedef instead of spelling out an insane type. Yay for auto someday.Chris Lattner2009-10-101-3/+3
| | | | llvm-svn: 83707
* Implement an efficient and fully general SSA update mechanism that Chris Lattner2009-10-101-0/+232
works on unstructured CFGs. This implements PR217, our oldest open PR. llvm-svn: 83705
OpenPOWER on IntegriCloud