summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/LCSSA.cpp
Commit message (Collapse)AuthorAgeFilesLines
* split dom frontier handling stuff out to its own DominanceFrontier header,Chris Lattner2011-01-021-3/+0
| | | | | | so that Dominators.h is *just* domtree. Also prune #includes a bit. llvm-svn: 122714
* Passes do not need to recursively initialize passes that they preserve, ifOwen Anderson2010-10-191-3/+0
| | | | | | | they do not also require them. This allows us to reduce inter-pass linkage dependencies. llvm-svn: 116854
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-191-1/+3
| | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. llvm-svn: 116820
* Begin adding static dependence information to passes, which will allow us toOwen Anderson2010-10-121-1/+7
| | | | | | | | | perform initialization without static constructors AND without explicit initialization by the client. For the moment, passes are required to initialize both their (potential) dependencies and any passes they preserve. I hope to be able to relax the latter requirement in the future. llvm-svn: 116334
* Now with fewer extraneous semicolons!Owen Anderson2010-10-071-1/+1
| | | | llvm-svn: 115996
* Reapply commit 112699, speculatively reverted by echristo, sinceDuncan Sands2010-09-021-1/+1
| | | | | | | | | 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-1/+1
| | | | | | self host errors on clang-x86-64. llvm-svn: 112719
* If PrototypeValue is erased in the middle of using the SSAUpdatorDuncan Sands2010-09-011-1/+1
| | | | | | | 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
* Now that PassInfo and Pass::ID have been separated, move the rest of the ↵Owen Anderson2010-08-231-1/+1
| | | | | | passes over to the new registration API. llvm-svn: 111815
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-061-2/+2
| | | | llvm-svn: 110460
* Revert r110396 to fix buildbots.Owen Anderson2010-08-061-2/+2
| | | | llvm-svn: 110410
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-051-2/+2
| | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. llvm-svn: 110396
* Remove LCSSA's bogus dependence on LoopSimplify and LoopSimplify's bogusDan Gohman2010-07-261-7/+2
| | | | | | | | | | | | | | dependence on DominanceFrontier. Instead, add an explicit DominanceFrontier pass in StandardPasses.h to ensure that it gets scheduled at the right time. Declare that loop unrolling preserves ScalarEvolution, and shuffle some getAnalysisUsages. This eliminates one LoopSimplify and one LCCSA run in the standard compile opts sequence. llvm-svn: 109413
* Reorder the contents of various getAnalysisUsage functions, eliminatingDan Gohman2010-07-161-11/+7
| | | | | | a redundant loopsimplify run from the default -O2 sequence. llvm-svn: 108539
* cache result of operator*Gabor Greif2010-07-091-3/+4
| | | | llvm-svn: 107968
* Add a DominatorTree argument to isLCSSA so that it doesn't have toDan Gohman2010-03-101-2/+2
| | | | | | | compute a set of reachable blocks for itself each time it is called, which is fairly frequently. llvm-svn: 98179
* Fix a comment in a typo that Duncan noticed.Dan Gohman2009-11-091-1/+1
| | | | llvm-svn: 86575
* Generalize LCSSA to handle loops with exits with predecessors outsideDan Gohman2009-11-091-2/+14
| | | | | | | | | | | | the loop. This is needed because with indirectbr it may not be possible for LoopSimplify to guarantee that all loop exit predecessors are inside the loop. This fixes PR5437. LCCSA no longer actually requires LoopSimplify form, but for now it must still have the dependency because the PassManager doesn't know how to schedule LoopSimplify otherwise. llvm-svn: 86569
* Delete an unused member variable.Dan Gohman2009-11-051-2/+0
| | | | llvm-svn: 86160
* rewrite LCSSA to use SSAUpdate, to only return true if it modifiesChris Lattner2009-10-111-154/+130
| | | | | | the IR, and to implement the FIXME'd optimization. llvm-svn: 83748
* clean up and simplify some code. Don't use setvector when things will beChris Lattner2009-10-111-28/+23
| | | | | | | inserted only once, just use vector. Don't compute ExitBlocks unless we need it, change std::sort to array_pod_sort. llvm-svn: 83747
* random tidyingChris Lattner2009-10-101-7/+5
| | | | llvm-svn: 83701
* Remove a redundant #ifndef and add an assertion string.Dan Gohman2009-09-281-3/+1
| | | | llvm-svn: 82991
* Re-apply r80926, with fixes: keep the domtree informed of new blocksDan Gohman2009-09-081-3/+14
| | | | | | | | | | | | | | | that get created during loop unswitching, and fix SplitBlockPredecessors' LCSSA updating code to create new PHIs instead of trying to just move existing ones. Also, optimize Loop::verifyLoop, since it gets called a lot. Use searches on a sorted list of blocks instead of calling the "contains" function, as is done in other places in the Loop class, since "contains" does a linear search. Also, don't call verifyLoop from LoopSimplify or LCSSA, as the PassManager is already calling verifyLoop as part of LoopInfo's verifyAnalysis. llvm-svn: 81221
* Revert r80926. It causes loop unswitch assertion and slow down some JIT ↵Evan Cheng2009-09-061-16/+3
| | | | | | tests significantly. llvm-svn: 81101
* Add a verifyAnalysis to LoopInfo, LoopSimplify, and LCSSA form that verifyDan Gohman2009-09-031-3/+16
| | | | | | | | | that these passes are properly preserved. Fix several transformation passes that claimed to preserve LoopSimplify form but weren't. llvm-svn: 80926
* Move more code back to 2.5 APIs.Owen Anderson2009-07-301-1/+1
| | | | llvm-svn: 77635
* Get rid of the Pass+Context magic.Owen Anderson2009-07-221-1/+1
| | | | llvm-svn: 76702
* More LLVMContext-ification.Owen Anderson2009-07-051-1/+2
| | | | llvm-svn: 74807
* Fix LCSSA to avoid emitting a PHI node for the unwind destination ofDan Gohman2009-06-261-2/+11
| | | | | | | an invoke instruction, since the value isn't really live across that edge. llvm-svn: 74242
* Real fix for PR3549, by using caching for predecessor counts in addition to ↵Owen Anderson2009-04-221-11/+13
| | | | | | | | the predecessors themselves. This halves the time to optimize the testcase, beyond what my previous patch did. llvm-svn: 69792
* Use PredIteratorCache in LCSSA, which gives a 37% overall speedup on the ↵Owen Anderson2009-04-221-2/+5
| | | | | | testcase from PR3549. More improvements to come. llvm-svn: 69788
* Simplify the logic of getting hold of a PHI predecessor block.Gabor Greif2009-01-231-4/+2
| | | | | | | | | There is now a direct way from value-use-iterator to incoming block in PHINode's API. This way we avoid the iterator->index->iterator trip, and especially the costly getOperandNo() invocation. Additionally there is now an assertion that the iterator really refers to one of the PHI's Uses. llvm-svn: 62869
* Change create*Pass factory functions to return Pass* instead ofDaniel Dunbar2008-10-221-1/+1
| | | | | | | | | | | LoopPass*. - Although less precise, this means they can be used in clients without RTTI (who would otherwise need to include LoopPass.h, which eventually includes things using dynamic_cast). This was the simplest solution that presented itself, but I am happy to use a better one if available. llvm-svn: 58010
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-1/+1
| | | | llvm-svn: 55779
* Enable first-class aggregates support.Dan Gohman2008-07-231-21/+1
| | | | | | | | | | | | Remove the GetResultInst instruction. It is still accepted in LLVM assembly and bitcode, where it is now auto-upgraded to ExtractValueInst. Also, remove support for return instructions with multiple values. These are auto-upgraded to use InsertValueInst instructions. The IRBuilder still accepts multiple-value returns, and auto-upgrades them to InsertValueInst instructions. llvm-svn: 53941
* Fix whitespace in whitespace-significant pseudocode in a comment.Dan Gohman2008-06-031-2/+2
| | | | llvm-svn: 51890
* Since LCSSA switched over to DenseMap, we have to be more careful to avoid ↵Owen Anderson2008-05-301-4/+5
| | | | | | iterator invalidation. Fixes PR2385. llvm-svn: 51777
* Use a DenseMap instead of an std::map, speeding up the testcase in PR2368 by ↵Owen Anderson2008-05-261-3/+3
| | | | | | about a third. llvm-svn: 51565
* Tidy up BasicBlock::getFirstNonPHI, and change a bunch of places toDan Gohman2008-05-231-3/+1
| | | | | | use it instead of duplicating its functionality. llvm-svn: 51499
* Fix a bunch of 80col violations that arose from the Create API change. Tweak ↵Gabor Greif2008-05-151-2/+2
| | | | | | makefile targets to find these better. llvm-svn: 51143
* Change class' public PassInfo variables to by initialized with theDan Gohman2008-05-131-1/+1
| | | | | | | | | | | address of the PassInfo directly instead of calling getPassInfo. This eliminates a bunch of dynamic initializations of static data. Also, fold RegisterPassBase into PassInfo, make a bunch of its data members const, and rearrange some code to initialize data members in constructors instead of using setter member functions. llvm-svn: 51022
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-3/+3
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* Handle multiple return values.Devang Patel2008-05-031-1/+23
| | | | llvm-svn: 50604
* API changes for class Use size reduction, wave 1.Gabor Greif2008-04-061-4/+4
| | | | | | | | Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. llvm-svn: 49277
* Fix newly-introduced 4.3 warningsAnton Korobeynikov2008-02-201-1/+1
| | | | llvm-svn: 47375
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Use SmallVector instead of std::vector.Devang Patel2007-08-211-7/+5
| | | | llvm-svn: 41207
* When one branch of condition is eliminated then head of the otherDevang Patel2007-08-171-1/+2
| | | | | | branch is not necessary immediate dominators of merge blcok in all cases. llvm-svn: 41144
* LCSSA preserves dom info.Devang Patel2007-07-301-0/+8
| | | | llvm-svn: 40604
OpenPOWER on IntegriCloud