summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Remove trailing whitespaceMisha Brukman2005-04-211-10/+10
| | | | llvm-svn: 21427
* Fix test/Regression/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.llxChris Lattner2004-11-301-0/+2
| | | | | | This only fails on darwin or on X86 under valgrind. llvm-svn: 18377
* Correction to allow compilation with Visual C++.Reid Spencer2004-10-181-2/+2
| | | | | | Patch contributed by Morten Ofstad. Thanks Morten! llvm-svn: 17123
* Fix a bug that occurs when the constant value is the result of an invoke. InChris Lattner2004-10-181-5/+6
| | | | | | | particular, invoke ret values are only live in the normal dest of the invoke not in the unwind dest. llvm-svn: 17108
* When inserting PHI nodes, don't insert any phi nodes that are obviouslyChris Lattner2004-10-171-10/+31
| | | | | | | | | unneccesary. This allows us to delete several hundred phi nodes of the form PHI(x,x,x,undef) from 253.perlbmk and probably other programs as well. This implements Mem2Reg/UndefValuesMerge.ll llvm-svn: 17098
* When promoting mem2reg, make uninitialized values become undef isntead of 0.Chris Lattner2004-10-161-9/+9
| | | | llvm-svn: 17045
* Remove a whole bunch of horrible hacky code that was used to promote allocasChris Lattner2004-09-191-145/+7
| | | | | | | | | whose addresses where used by trivial phi nodes and select instructions. This is now performed by the instcombine pass, which is more powerful, is much simpler, and is faster. This allows the deletion of a bunch of code, two FIXME's and two gotos. llvm-svn: 16406
* Make sure to remove the Select instruction as wellChris Lattner2004-09-181-0/+1
| | | | llvm-svn: 16389
* If given an AliasSetTracker object to update, update it.Chris Lattner2004-09-151-20/+81
| | | | llvm-svn: 16347
* Fixes to make LLVM compile with vc7.1.Alkis Evlogimenos2004-09-031-0/+1
| | | | | | Patch contributed by Paolo Invernizzi! llvm-svn: 16152
* Changes For Bug 352Reid Spencer2004-09-011-1/+1
| | | | | | | | Move include/Config and include/Support into include/llvm/Config, include/llvm/ADT and include/llvm/Support. From here on out, all LLVM public header files must be under include/llvm/. llvm-svn: 16137
* Fix #includes of i*.h => Instructions.h as per PR403.Misha Brukman2004-07-291-3/+1
| | | | llvm-svn: 15334
* Change to use the StableBasicBlockNumbering classChris Lattner2004-06-191-15/+7
| | | | llvm-svn: 14247
* Do not let the numbering of PHI nodes placed in the function depend onChris Lattner2004-06-191-2/+36
| | | | | | | | | | | | | | | | | | | non-deterministic things like the ordering of blocks in the dominance frontier of a BB. Unfortunately, I don't know of a better way to solve this problem than to explicitly sort the BB's in function-order before processing them. This is guaranteed to slow the pass down a bit, but is absolutely necessary to get usable diffs between two different tools executing the mem2reg or scalarrepl pass. Before this, bazillions of spurious diff failures occurred all over the place due to the different order of processing PHIs: - %tmp.111 = getelementptr %struct.Connector_struct* %upcon.0.0, uint 0, uint 0 + %tmp.111 = getelementptr %struct.Connector_struct* %upcon.0.1, uint 0, uint 0 Now, the diffs match. llvm-svn: 14244
* Implement ScalarRepl/select_promote.llChris Lattner2004-04-081-0/+53
| | | | llvm-svn: 12779
* Bunch up all locally used allocas by the block they are allocated in, andChris Lattner2004-02-031-13/+74
| | | | | | | process them all as a group. This speeds up SRoA/mem2reg from 28.46s to 0.62s on the testcase from PR209. llvm-svn: 11100
* Handle extremely trivial cases extremely efficiently. This speeds upChris Lattner2004-02-031-17/+30
| | | | | | SRoA/mem2reg from 41.2s to 27.5s on the testcase in PR209. llvm-svn: 11099
* Implement Transforms/ScalarRepl/phinodepromote.ll, which is an importantChris Lattner2004-01-121-17/+86
| | | | | | case that the C/C++ front-end generates. llvm-svn: 10761
* Finegrainify namespacificationChris Lattner2004-01-091-8/+5
| | | | llvm-svn: 10727
* Put all LLVM code into the llvm namespace, as per bug 109.Brian Gaeke2003-11-111-0/+4
| | | | llvm-svn: 9903
* Added LLVM project notice to the top of every C++ source file.John Criswell2003-10-201-0/+7
| | | | | | Header files will be on the way. llvm-svn: 9298
* Fix PR#50Chris Lattner2003-10-181-6/+6
| | | | llvm-svn: 9227
* This changes the PromoteMemToReg function to create "pruned" SSA form, notChris Lattner2003-10-051-24/+109
| | | | | | | | | | | | | | | | | | | | "minimal" SSA form (in other words, it doesn't insert dead PHIs). This speeds up the mem2reg pass very significantly because it doesn't have to do a lot of frivolous work in many common cases. In the 252.eon function I have been playing with, this doesn't even insert the 120 PHI nodes that it used to which were trivially dead (in the process of promoting 356 alloca instructions overall). This speeds up the mem2reg pass from 1.2459s to 0.1284s. More significantly, the DCE pass used to take 2.4138s to remove the 120 dead PHI nodes that mem2reg constructed, now it takes 0.0134s (which is the time to scan the function and decide that there is nothing dead). So overall, on this one function, we speed things up a total of 3.5179s, which is a 24.8x speedup! :) This change is tested by the Mem2Reg/2003-10-05-DeadPHIInsertion.ll test, which now passes. llvm-svn: 8884
* Change the interface to PromoteMemToReg to also take a DominatorTreeChris Lattner2003-10-051-1/+2
| | | | llvm-svn: 8883
* Speed up the mem2reg transform for allocas which are only read/written in a ↵Chris Lattner2003-10-051-5/+84
| | | | | | | | | | | | | | | | | | | | | | | single basic block. This is amazingly common in code generated by the C/C++ front-ends. This change makes it not have to insert ANY phi nodes, whereas before it would insert a ton of dead ones which DCE would have to clean up. Thus, this fix improves compile-time performance of these trivial allocas in two ways: 1. It doesn't have to do the walking and book-keeping for renaming 2. It does not insert dead phi nodes for them which would have to subsequently be cleaned up. On my favorite testcase from 252.eon, this special case handles 305 out of 356 promoted allocas in the function. It speeds up the mem2reg pass from 7.5256s to 1.2505s. It inserts 677 fewer dead PHI nodes, which speeds up a subsequent -dce pass from 18.7524s to 2.4806s. There are still 120 trivially dead PHI nodes being inserted for variables used in multiple basic blocks, but they are not handled by this patch. llvm-svn: 8881
* The first PHI node may be null, scan for the first non-null oneChris Lattner2003-10-051-1/+4
| | | | llvm-svn: 8865
* The VersionNumbers vector is only used during PHI placement. Turn it into ↵Chris Lattner2003-10-051-10/+6
| | | | | | an argument, allowing us to get rid of the vector. llvm-svn: 8864
* * Update file header commentChris Lattner2003-10-051-44/+64
| | | | | | | | | | | | | *** Revamp the code which handled unreachable code in the function. Now the code is much more efficient for high-degree basic blocks, such as those that occur in the 252.eon SPEC benchmark. For the interested, the time to promote a SINGLE alloca in _ZN7mrScene4ReadERSi function used to be > 3.5s. Now it is < .075s. The function has a LOT of allocas in it, so it appeared to be infinite looping, this should make it much nicer. :) llvm-svn: 8863
* Simplify the loop a bitChris Lattner2003-10-051-10/+9
| | | | llvm-svn: 8862
* There is no need for separate WriteSets and PhiNodeBlocks lists. It is just aChris Lattner2003-10-051-18/+8
| | | | | | | work-list of value definitions. This allows elimination of the explicit 'iterative' step of the algorithm, and also reuses temporary memory better. llvm-svn: 8861
* The PhiNodes 2D vector is only used during PHI node placement. It doesn'tChris Lattner2003-10-051-11/+10
| | | | | | need to be an instance variable! llvm-svn: 8860
* * Document instance vars betterChris Lattner2003-10-051-20/+26
| | | | | | | * Fuse two parallel loops * Use a more specific type for AllocaLookup llvm-svn: 8859
* Two small cleanups/speedups:Chris Lattner2003-10-051-29/+31
| | | | | | | * Do not insert a new entry into NewPhiNodes during the rename pass if there are no PHIs in a block. * Do not compute WriteSets in parallel llvm-svn: 8858
* * Minor cleanupsChris Lattner2003-10-051-42/+28
| | | | | | | | * Eliminate the KillList instance variable, instead, just delete loads and stores as they are "renamed", and delete allocas when they are done * Make the 'visited' set an instance variable to avoid passing it on the stack. llvm-svn: 8857
* Spell `necessary' correctly.Misha Brukman2003-08-181-1/+1
| | | | llvm-svn: 7944
* Fix bug: mem2reg/2003-04-24-MultipleIdenticalSuccessors.llChris Lattner2003-04-251-7/+8
| | | | llvm-svn: 5919
* Fix iterator invalidation problemChris Lattner2003-04-241-2/+7
| | | | llvm-svn: 5895
* Fix bug where use still existed in dead codeChris Lattner2003-04-211-0/+2
| | | | llvm-svn: 5824
* Fix bug: Mem2reg/2003-04-18-DeadBlockProblem.llChris Lattner2003-04-181-4/+17
| | | | llvm-svn: 5810
* * Fix bug: Mem2Reg/2003-04-10-DFNotFound.llChris Lattner2003-04-101-9/+26
| | | | | | | * Make Mem2Reg assign version numbers now for renamed variables instead of .mem2reg suffixes. This produces what people think of as SSA. llvm-svn: 5771
* Change the mem2reg interface to accept a TargetData argumentChris Lattner2003-03-031-6/+11
| | | | llvm-svn: 5685
OpenPOWER on IntegriCloud