summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
Commit message (Collapse)AuthorAgeFilesLines
* rename use_const_iterator to const_use_iterator for consistency's sakeGabor Greif2010-03-251-1/+1
| | | | llvm-svn: 99564
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-161-6/+6
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* mem2reg erases the dbg.declare intrinsics that it converts to dbg.val intrinsicsVictor Hernandez2010-01-291-3/+13
| | | | llvm-svn: 94763
* some cleanups.Chris Lattner2010-01-271-14/+15
| | | | llvm-svn: 94649
* no need to check for nullChris Lattner2010-01-271-1/+1
| | | | llvm-svn: 94648
* When converting dbg.declare to dbg.value, attach promoted store's debug ↵Victor Hernandez2010-01-271-1/+4
| | | | | | metadata to dbg.value llvm-svn: 94634
* Switch AllocaDbgDeclares to SmallVector and don't leak DIFactoryVictor Hernandez2010-01-261-1/+4
| | | | llvm-svn: 94567
* In mem2reg, for all alloca/stores that get promoted where the alloca has an ↵Victor Hernandez2010-01-261-1/+52
| | | | | | associated llvm.dbg.declare instrinsic, insert an llvm.dbg.var intrinsic before each store. llvm-svn: 94493
* Revert r94260 until findDbgDeclare() is made more efficientVictor Hernandez2010-01-251-38/+3
| | | | llvm-svn: 94432
* In mem2reg, for all alloca/stores that get promoted where the alloca has an ↵Victor Hernandez2010-01-231-3/+38
| | | | | | associated llvm.dbg.declare instrinsic, insert an llvm.dbg.var intrinsic before each store llvm-svn: 94260
* Keep ignoring pointer-to-pointer bitcastsVictor Hernandez2010-01-221-3/+0
| | | | llvm-svn: 94194
* DbgInfoIntrinsic no longer appear in an instruction's use listVictor Hernandez2010-01-211-19/+4
| | | | llvm-svn: 94113
* Use do+while instead of while for loops which obviously have aDan Gohman2010-01-051-2/+2
| | | | | | non-zero trip count. Use SmallVector's pop_back_val(). llvm-svn: 92734
* Remove isPod() from DenseMapInfo, splitting it out to its ownChris Lattner2009-12-151-1/+0
| | | | | | | | isPodLike type trait. This is a generally useful type trait for more than just DenseMap, and we really care about whether something acts like a pod, not whether it really is a pod. llvm-svn: 91421
* Don't leave pointers uninitialized in the default constructor. GCC complainsChandler Carruth2009-12-131-1/+1
| | | | | | about the potential use of these uninitialized members under certain conditions. llvm-svn: 91239
* Pull LLVMContext out of PromoteMemToReg.Nick Lewycky2009-11-231-8/+4
| | | | llvm-svn: 89645
* fix a bug exposed by moving SRoA earlier which caused a crash building kc++Chris Lattner2009-11-021-1/+6
| | | | llvm-svn: 85786
* Remove includes of Support/Compiler.h that are no longer needed after theNick Lewycky2009-10-251-1/+0
| | | | | | VISIBILITY_HIDDEN removal. llvm-svn: 85043
* Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.Nick Lewycky2009-10-251-3/+3
| | | | | | | Chris claims we should never have visibility_hidden inside any .cpp file but that's still not true even after this commit. llvm-svn: 85042
* tidy upChris Lattner2009-09-211-7/+8
| | | | llvm-svn: 82488
* Change PHINode::hasConstantValue to have a DominatorTree argumentDan Gohman2009-09-031-11/+8
| | | | | | | | instead of a bool argument, and to do the dominator check itself. This makes it eaiser to use when DominatorTree information is available. llvm-svn: 80920
* Fix a bunch of namespace pollution.Dan Gohman2009-08-071-0/+3
| | | | llvm-svn: 78363
* Move more code back to 2.5 APIs.Owen Anderson2009-07-301-4/+4
| | | | llvm-svn: 77635
* Twines: Don't allow implicit conversion from integers, this is too tricky.Daniel Dunbar2009-07-301-1/+1
| | | | llvm-svn: 77605
* Switch obvious clients to Twine instead of utostr (when they were already usingDaniel Dunbar2009-07-301-3/+2
| | | | | | | | | a Twine, e.g., for names). - I am a little ambivalent about this; we don't want the string conversion of utostr, but using overload '+' mixed with string and integer arguments is sketchy. On the other hand, this particular usage is something of an idiom. llvm-svn: 77579
* Get rid of the Pass+Context magic.Owen Anderson2009-07-221-7/+7
| | | | llvm-svn: 76702
* "LLVMContext* " --> "LLVMContext *"Owen Anderson2009-07-061-3/+3
| | | | llvm-svn: 74878
* More LLVMContext-ification.Owen Anderson2009-07-051-8/+12
| | | | llvm-svn: 74807
* Simplify code by using SmallVector's pop_back_val() instead ofDan Gohman2009-05-061-2/+1
| | | | | | separate back() and pop_back() calls. llvm-svn: 71089
* Fix for PR3944: make mem2reg O(N) instead of O(N^2) in the number of Eli Friedman2009-04-161-19/+11
| | | | | | incoming edges for a block with many predecessors. llvm-svn: 69312
* Tweak the check for promotable alloca's to handleDale Johannesen2009-03-061-1/+7
| | | | | | debug intrinsics correctly. llvm-svn: 66225
* Let AnalyzeAlloca() remove debug intrinsics.Devang Patel2008-11-171-20/+11
| | | | llvm-svn: 59454
* Rework r58829, allowing removal of dbg info intrinsics during allocaDaniel Dunbar2008-11-081-20/+24
| | | | | | | | promotion. - Eliminate uses after free and simplify tests. Devang: Please check that this is still doing what you intended. llvm-svn: 58887
* BCUI + 1 doesn't work. Use next instead.Bill Wendling2008-11-071-1/+2
| | | | llvm-svn: 58830
* Handle (delete) dbg intrinsics while promoting alloca.Devang Patel2008-11-071-3/+22
| | | | llvm-svn: 58826
* Rewrite all the 'PromoteLocallyUsedAlloca[s]' logic. With the power ofChris Lattner2008-10-271-175/+97
| | | | | | | | | | | | | | | | LargeBlockInfo, we can now dramatically simplify their implementation and speed them up at the same time. Now the code has time proportional to the number of uses of the alloca, not the size of the block. This also eliminates code that tried to batch up different allocas which are used in the same blocks, and eliminates the 'retry list' logic which was baroque and no unneccesary. In addition to being a speedup for crazy cases, this is also a nice cleanup: PromoteMemoryToRegister.cpp | 270 +++++++++++++++----------------------------- 1 file changed, 96 insertions(+), 174 deletions(-) llvm-svn: 58229
* Add a new LargeBlockInfo helper, which is just a wrapper aroundChris Lattner2008-10-271-57/+123
| | | | | | | | | a trivial dense map. Use this in RewriteSingleStoreAlloca to avoid aggressively rescanning blocks over and over again. This fixes PR2925, speeding up mem2reg on the testcase in that bug from 4.56s to 0.02s in a debug build on my machine. llvm-svn: 58227
* API changes for class Use size reduction, wave 1.Gabor Greif2008-04-061-3/+3
| | | | | | | | Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. llvm-svn: 49277
* Update -mem2reg to use succ_iterator instead of iterating across TerminatorInstNick Lewycky2008-03-131-13/+10
| | | | | | successors. This makes it support nounwind. llvm-svn: 48320
* 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
OpenPOWER on IntegriCloud