aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Utils/LCSSA.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69792 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69788 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62869 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58010 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53941 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix whitespace in whitespace-significant pseudocode in a comment.Dan Gohman2008-06-031-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51890 91177308-0d34-0410-b5e6-96231b3b80d8
* Since LCSSA switched over to DenseMap, we have to be more careful to avoid ↵Owen Anderson2008-05-301-4/+5
| | | | | | iterator invalidation. Fixes PR2385. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51777 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a DenseMap instead of an std::map, speeding up the testcase in PR2368 by ↵Owen Anderson2008-05-261-3/+3
| | | | | | about a third. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51565 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up BasicBlock::getFirstNonPHI, and change a bunch of places toDan Gohman2008-05-231-3/+1
| | | | | | | use it instead of duplicating its functionality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51499 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51143 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51022 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51017 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle multiple return values.Devang Patel2008-05-031-1/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50604 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49277 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix newly-introduced 4.3 warningsAnton Korobeynikov2008-02-201-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47375 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
* Use SmallVector instead of std::vector.Devang Patel2007-08-211-7/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41207 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41144 91177308-0d34-0410-b5e6-96231b3b80d8
* LCSSA preserves dom info.Devang Patel2007-07-301-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40604 91177308-0d34-0410-b5e6-96231b3b80d8
* Now this temp. fix is not required.Devang Patel2007-07-191-4/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40034 91177308-0d34-0410-b5e6-96231b3b80d8
* Return Undef if the block has no dominator. This was required to allowReid Spencer2007-07-161-0/+4
| | | | | | | | | llvm-gcc build to succeed. Without this change it fails in libstdc++ compilation. This causes no regressions in dejagnu tests. However, someone who knows this code better might want to review it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39924 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LCSSA a loop pass.Devang Patel2007-07-131-21/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39844 91177308-0d34-0410-b5e6-96231b3b80d8
* Maintain ETNode as part of DomTreeNode.Devang Patel2007-06-071-1/+1
| | | | | | | This adds redundancy for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37492 91177308-0d34-0410-b5e6-96231b3b80d8
* s/llvm::DominatorTreeBase::DomTreeNode/llvm::DomTreeNode/gDevang Patel2007-06-041-8/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37407 91177308-0d34-0410-b5e6-96231b3b80d8
* s/DominatorTreeBase::Node/DominatorTreeBase:DomTreeNode/gDevang Patel2007-06-031-8/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37403 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typos.Dan Gohman2007-05-111-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36994 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo in comment.Nick Lewycky2007-05-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36873 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop 'const'Devang Patel2007-05-031-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36662 91177308-0d34-0410-b5e6-96231b3b80d8
* Use 'static const char' instead of 'static const int'.Devang Patel2007-05-021-2/+2
| | | | | | | | Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36652 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not use typeinfo to identify pass in pass manager.Devang Patel2007-05-011-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36632 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert Owen's last check-in. This is breaking Mac OS X / PPC llvm-gcc bootstrap.Evan Cheng2007-04-181-18/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36258 91177308-0d34-0410-b5e6-96231b3b80d8
* Use ETForest instead of DominatorTree.Owen Anderson2007-04-181-21/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36247 91177308-0d34-0410-b5e6-96231b3b80d8
* avoid copying sets and vectors around.Chris Lattner2007-04-141-7/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36017 91177308-0d34-0410-b5e6-96231b3b80d8
* Apply the VISIBILITY_HIDDEN field to the remaining anonymous classes inReid Spencer2007-02-051-1/+2
| | | | | | | | the Transforms library. This reduces debug library size by 132 KB, debug binary size by 376 KB, and reduces link time for llvm tools slightly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33939 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1177:Reid Spencer2007-02-051-4/+4
| | | | | | | Revert last patch which caused iteration invalidation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33901 91177308-0d34-0410-b5e6-96231b3b80d8
* Use DenseMap for pointer->pointer maps.Owen Anderson2007-02-051-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33897 91177308-0d34-0410-b5e6-96231b3b80d8
* switch more statistics over to STATISTIC, eliminating static ctors. Also,Chris Lattner2006-12-191-4/+3
| | | | | | | delete some dead ones. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32694 91177308-0d34-0410-b5e6-96231b3b80d8
* Detemplatize the Statistic class. The only type it is instantiated withChris Lattner2006-12-061-1/+1
| | | | | | | is 'unsigned'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32279 91177308-0d34-0410-b5e6-96231b3b80d8
* generalize the fix for PR977 to also fixChris Lattner2006-10-311-28/+26
| | | | | | | Transforms/LCSSA/2006-10-31-UnreachableBlock-2.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31317 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR977 and Transforms/LCSSA/2006-10-31-UnreachableBlock.llChris Lattner2006-10-311-1/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31315 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate RegisterOpt. It does the same thing as RegisterPass.Chris Lattner2006-08-271-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29925 91177308-0d34-0410-b5e6-96231b3b80d8
* Add special check to avoid isLoop call. Simple, but doesn't seem to speedChris Lattner2006-08-021-2/+2
| | | | | | | up lcssa much in practice. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29465 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace the SSA update code in LCSSA with a bottom-up approach instead of a topChris Lattner2006-08-021-125/+95
| | | | | | | | | | | | | | | | | | down approach, inspired by discussions with Tanya. This approach is significantly faster, because it does not need dominator frontiers and it does not insert extraneous unused PHI nodes. For example, on 252.eon, in a release-asserts build, this speeds up LCSSA (which is the slowest pass in gccas) from 9.14s to 0.74s on my G5. This code is also slightly smaller and significantly simpler than the old code. Amusingly, in a normal Release build (which includes the "assert(L->isLCSSAForm());" assertion), asserting that the result of LCSSA is in LCSSA form is actually slower than the LCSSA transformation pass itself on 252.eon. I will see if Loop::isLCSSAForm can be sped up next. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29463 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo in the comment.Owen Anderson2006-07-091-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29078 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a fix for an issue where LCSSA would fail to insert undef's in some cornerOwen Anderson2006-07-091-14/+21
| | | | | | | | cases. Ideally, this issue will go away in the future as LCSSA gets smarter about which Phi nodes it inserts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29076 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the PotDoms map to memoize 'dominating value' lookup. With this patch,Chris Lattner2006-06-141-17/+14
| | | | | | | | LCSSA is still the slowest pass when gccas'ing 252.eon, but now it only takes 39s instead of 289s. :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28776 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix another instance where PHI nodes need special treatment.Owen Anderson2006-06-131-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28774 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug that was causing major slowdowns in povray. This was due to LCSSAOwen Anderson2006-06-131-2/+7
| | | | | | | | | | not handling PHI nodes correctly when determining if a value was live-out. This patch reduces the number of detected live-out variables in the testcase from 6565 to 485. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28771 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for 2006-06-26-MultipleExitsSingleBlock.Owen Anderson2006-06-121-4/+7
| | | | | | | | | If a single exit block has multiple predecessors within the loop, it will appear in the exit blocks list more than once. LCSSA needs to take that into account so that it doesn't double process that exit block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28750 91177308-0d34-0410-b5e6-96231b3b80d8