summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make RenamePass faster by making the 'is this a new phi node'Chris Lattner2008-02-051-11/+11
| | | | | | | | check more intelligent. This speeds up mem2reg from 5.29s to 0.79s on a synthetic testcase with tons of predecessors and phi nodes. llvm-svn: 46767
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Finishing initial docs for all transformations in Passes.html.Gordon Henriksen2007-11-041-1/+1
| | | | | | Also cleaned up some comments in source files. llvm-svn: 43674
* Merge DenseMapKeyInfo & DenseMapValueInfo into DenseMapInfoChris Lattner2007-09-171-7/+11
| | | | | | | Add a new DenseMapInfo::isEqual method to allow clients to redefine the equality predicate used when probing the hash table. llvm-svn: 42042
* Don't promote volatile loads/stores. This is needed (for example) to handle ↵Anton Korobeynikov2007-08-261-3/+6
| | | | | | | | setjmp/longjmp properly. This fixes PR1520. llvm-svn: 41461
* rewrite the code used to construct pruned SSA form with the IDF method.Chris Lattner2007-08-041-82/+114
| | | | | | | | | | | | | | | | In the old way, we computed and inserted phi nodes for the whole IDF of the definitions of the alloca, then computed which ones were dead and removed them. In the new method, we first compute the region where the value is live, and use that information to only insert phi nodes that are live. This eliminates the need to compute liveness later, and stops the algorithm from inserting a bunch of phis which it then later removes. This speeds up the testcase in PR1432 from 2.00s to 0.15s (14x) in a release build and 6.84s->0.50s (14x) in a debug build. llvm-svn: 40825
* Factor out a whole bunch of code into it's own method.Chris Lattner2007-08-041-65/+82
| | | | llvm-svn: 40824
* Use getNumPreds(BB) instead of computing them manually. This is a very small butChris Lattner2007-08-041-4/+4
| | | | | | measurable speedup. llvm-svn: 40823
* Change the rename pass to be "tail recursive", only adding N-1 successorsChris Lattner2007-08-041-21/+35
| | | | | | | to the worklist, and handling the last one with a 'tail call'. This speeds up PR1432 from 2.0578s to 2.0012s (2.8%) llvm-svn: 40822
* cache computation of #preds for a BB. This speeds upChris Lattner2007-08-041-3/+14
| | | | | | mem2reg from 2.0742->2.0522s on PR1432. llvm-svn: 40821
* reserve operand space for phi nodes when we insert them.Chris Lattner2007-08-041-0/+1
| | | | llvm-svn: 40820
* use continue to avoid nesting, no functionality change.Chris Lattner2007-08-041-14/+15
| | | | llvm-svn: 40819
* Promoting allocas with the 'single store' fastpath is Chris Lattner2007-08-041-10/+9
| | | | | | | faster than with the 'local to a block' fastpath. This speeds up PR1432 from 2.1232 to 2.0686s (2.6%) llvm-svn: 40818
* When PromoteLocallyUsedAllocas promoted allocas, it didn't rememberChris Lattner2007-08-041-2/+13
| | | | | | | to increment NumLocalPromoted, and didn't actually delete the dead alloca, leading to an extra iteration of mem2reg. llvm-svn: 40817
* std::map -> DenseMapChris Lattner2007-08-041-3/+3
| | | | llvm-svn: 40816
* fix a logic bug where we wouldn't promote single store allocas if the Chris Lattner2007-08-041-2/+2
| | | | | | | | | stored value was a non-instruction value. Doh. This increase the # single store allocas from 8982 to 9026, and speeds up mem2reg on the testcase in PR1432 from 2.17 to 2.13s. llvm-svn: 40813
* When we do the single-store optimization, delete both the storeChris Lattner2007-08-041-2/+8
| | | | | | | | and the alloca so they don't get reprocessed. This speeds up PR1432 from 2.20s to 2.17s. llvm-svn: 40812
* Three improvements:Chris Lattner2007-08-041-6/+16
| | | | | | | | | | | | | 1. Check for revisiting a block before checking domination, which is faster. 2. If the stored value isn't an instruction, we don't have to check for domination. 3. If we have a value used in the same block more than once, make sure to remove the block from the UsingBlocks vector. Not doing so forces us to go through the slow path for the alloca. The combination of these improvements increases the number of allocas on the fastpath from 8935 to 8982 on PR1432. This speeds it up from 2.90s to 2.20s (31%) llvm-svn: 40811
* switch from using a std::set to using a SmallPtrSet. This speeds up theChris Lattner2007-08-041-3/+3
| | | | | | testcase in PR1432 from 6.33s to 2.90s (2.22x) llvm-svn: 40810
* In mem2reg, when handling the single-store case, make sure to removeChris Lattner2007-08-041-8/+10
| | | | | | | | | | a using block from the list if we handle it. Not doing this caused us to not be able to promote (with the fast path) allocas which have uses (whoops). This increases the # allocas hitting this fastpath from 4042 to 8935 on the testcase in PR1432, speeding up mem2reg by 2.6x llvm-svn: 40809
* split rewriting of single-store allocas into its ownChris Lattner2007-08-041-39/+57
| | | | | | method. llvm-svn: 40806
* refactor some code to shrink PromoteMem2Reg::run a bitChris Lattner2007-08-041-63/+96
| | | | llvm-svn: 40805
* add a typedef, no other change.Chris Lattner2007-08-041-7/+8
| | | | llvm-svn: 40804
* avoid an unneeded vector copy. This speeds up mem2reg on the testcase Chris Lattner2007-08-041-1/+9
| | | | | | in PR1432 by 6% llvm-svn: 40803
* make RenamePassWorkList a local var instead of an ivar.Chris Lattner2007-08-041-8/+8
| | | | llvm-svn: 40802
* Use DominatorTree instead of ETForest.Devang Patel2007-06-071-10/+12
| | | | | | This allows faster immediate domiantor walk. llvm-svn: 37500
* Mem2Reg does not need TargetData.Devang Patel2007-04-251-7/+5
| | | | llvm-svn: 36444
* Remove unused function argument.Devang Patel2007-04-251-2/+2
| | | | llvm-svn: 36441
* Fix a comment.Owen Anderson2007-04-211-1/+1
| | | | llvm-svn: 36299
* Move more passes to using ETForest instead of DominatorTree.Owen Anderson2007-04-201-10/+9
| | | | llvm-svn: 36271
* Reduce malloc/free traffic.Devang Patel2007-03-261-12/+8
| | | | llvm-svn: 35370
* Remove dead comments.Devang Patel2007-03-091-3/+0
| | | | llvm-svn: 35053
* Avoid recursion. Use iterative algorithm for RenamePass().Devang Patel2007-03-091-4/+31
| | | | llvm-svn: 35052
* redesign the primary datastructure used by mem2reg to eliminate anChris Lattner2007-02-071-103/+156
| | | | | | std::map of std::vector's (ouch!). This speeds up mem2reg by 10% on 176.gcc. llvm-svn: 33974
* With the last change, we no longer need both directions of mapping fromChris Lattner2007-02-051-4/+8
| | | | | | | | BBNumbers. Instead of using a bi-directional mapping, just use a single densemap. This speeds up mem2reg on 176.gcc by 8%, from 1.3489 to 1.2485s. llvm-svn: 33940
* Simplify use of DFBlocks, this makes no noticable performance difference,Chris Lattner2007-02-051-3/+3
| | | | | | but paves the way to eliminate BBNumbers. llvm-svn: 33938
* Switch InsertedPHINodes back to SmallPtrSet now that the SmallPtrSet::eraseChris Lattner2007-02-051-6/+6
| | | | | | bug is fixed. llvm-svn: 33932
* switch a SmallPtrSet back to an std::set for now, this caused problems.Chris Lattner2007-02-051-6/+6
| | | | llvm-svn: 33930
* switch an std::set over to a SmallPtrSet, speeding up mem2reg 6% on 176.gcc.Chris Lattner2007-02-051-1/+1
| | | | llvm-svn: 33929
* switch an std::set over to SmallPtrSet, speeding up mem2reg 3.4% on 176.gcc.Chris Lattner2007-02-051-16/+13
| | | | llvm-svn: 33928
* eliminate some malloc traffic, this speeds up mem2reg by 3.4%.Chris Lattner2007-02-051-5/+8
| | | | llvm-svn: 33927
* s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|Chris Lattner2006-08-271-1/+1
| | | | llvm-svn: 29911
* Use hidden visibility to make symbols in an anonymous namespace getChris Lattner2006-06-281-1/+2
| | | | | | dropped. This shrinks libllvmgcc.dylib another 67K llvm-svn: 28975
* Fix some nondeterminstic behavior in the mem2reg pass that (in addition toChris Lattner2006-04-271-20/+38
| | | | | | | | | | nondeterminism being bad) could cause some trivial missed optimizations (dead phi nodes being left around for later passes to clean up). With this, llvm-gcc4 now bootstraps and correctly compares. I don't know why I never tried to do it before... :) llvm-svn: 27984
* Implement a refinement to the mem2reg algorithm for cases where an allocaChris Lattner2005-11-181-0/+55
| | | | | | | | | | has a single def. In this case, look for uses that are dominated by the def and attempt to rewrite them to directly use the stored value. This speeds up mem2reg on these values and reduces the number of phi nodes inserted. This should address PR665. llvm-svn: 24411
* This needs proper dominanceChris Lattner2005-11-181-5/+14
| | | | llvm-svn: 24410
* This code can handle non-dominating instructionsChris Lattner2005-08-051-1/+1
| | | | llvm-svn: 22667
* Fix a fixme in CondPropagate.cpp by moving a PhiNode optimization intoNate Begeman2005-08-041-2/+1
| | | | | | | | BasicBlock's removePredecessor routine. This requires shuffling around the definition and implementation of hasContantValue from Utils.h,cpp into Instructions.h,cpp llvm-svn: 22664
* Eliminate all remaining tabs and trailing spaces.Jeff Cohen2005-07-271-1/+1
| | | | llvm-svn: 22523
* Fix PR590 and Transforms/Mem2Reg/2005-06-30-ReadBeforeWrite.ll.Chris Lattner2005-06-301-19/+65
| | | | | | | | The optimization for locally used allocas was not safe for allocas that were read before they were written. This change disables that optimization in that case. llvm-svn: 22318
OpenPOWER on IntegriCloud