aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Update commentChris Lattner2003-10-081-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8965 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a set to keep track of which edges have been noticed as executable alreadyChris Lattner2003-10-081-15/+27
| | | | | | | | to avoid reprocessing PHI nodes needlessly. This speeds up the big bad PHI testcase 43%: from 104.9826 to 73.5157s git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8964 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor fixes here and thereChris Lattner2003-10-081-22/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8963 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid building data structures we don't really need. This improves the runtimeChris Lattner2003-10-081-10/+39
| | | | | | | | | of a test that Bill Wendling sent me from 228.5s to 105s. Obviously there is more improvement to be had, but this is a nice speedup which should be "felt" by many programs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8962 91177308-0d34-0410-b5e6-96231b3b80d8
* whoops, don't accidentally lose variable namesChris Lattner2003-10-071-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8955 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug: InstCombine/cast.ll:test11 / PR#7Chris Lattner2003-10-071-1/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8954 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor code a bitChris Lattner2003-10-071-4/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8952 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bugzilla bug #5Chris Lattner2003-10-071-1/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8930 91177308-0d34-0410-b5e6-96231b3b80d8
* Bill contributed this major rewrite of the -lowerswitch pass to make it generateChris Lattner2003-10-071-44/+144
| | | | | | | logarithmic conditional branch sequences instead of linear sequences. Thanks Bill! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8928 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug in previous checkinChris Lattner2003-10-071-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8922 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor speedups for the instcombine passChris Lattner2003-10-061-17/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8894 91177308-0d34-0410-b5e6-96231b3b80d8
* Speed up the predicate used to decide when to inline by caching the sizeChris Lattner2003-10-061-13/+28
| | | | | | | | | | | | | | | | | of callees between executions. On eon, in release mode, this changes the inliner from taking 11.5712s to taking 2.2066s. In debug mode, it went from taking 14.4148s to taking 7.0745s. In release mode, this is a 24.7% speedup of gccas, in debug mode, it's a total speedup of 11.7%. This also makes it slightly more aggressive. This could be because we are not judging the size of the functions quite as accurately as before. When we start looking at the performance of the generated code, this can be investigated further. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8893 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid doing pointless work. Amazingly, this makes us go faster.Chris Lattner2003-10-062-8/+5
| | | | | | | | | | | Running the inliner on 252.eon used to take 48.4763s, now it takes 14.4148s. In release mode, it went from taking 25.8741s to taking 11.5712s. This also fixes a FIXME. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8890 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8884 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the interface to PromoteMemToReg to also take a DominatorTreeChris Lattner2003-10-054-5/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8883 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8881 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial checkin of the LLVM->LLVM transform to support code generators whichChris Lattner2003-10-051-0/+74
| | | | | | | do not support stack unwinding yet git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8869 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify-cfg is really a function passChris Lattner2003-10-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8868 91177308-0d34-0410-b5e6-96231b3b80d8
* The first PHI node may be null, scan for the first non-null oneChris Lattner2003-10-051-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8865 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8864 91177308-0d34-0410-b5e6-96231b3b80d8
* * 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. :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8863 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the loop a bitChris Lattner2003-10-051-10/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8862 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8861 91177308-0d34-0410-b5e6-96231b3b80d8
* 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! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8860 91177308-0d34-0410-b5e6-96231b3b80d8
* * Document instance vars betterChris Lattner2003-10-051-20/+26
| | | | | | | | * Fuse two parallel loops * Use a more specific type for AllocaLookup git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8859 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8858 91177308-0d34-0410-b5e6-96231b3b80d8
* * 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8857 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement InstCombine/add.ll:test17 & 18Chris Lattner2003-10-021-0/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8817 91177308-0d34-0410-b5e6-96231b3b80d8
* Use global *_iteratorChris Lattner2003-09-241-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8703 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not use BasicBlock::*_iterator, just use *_iterator itself.Chris Lattner2003-09-244-8/+4
| | | | | | | Isn't updating copy and pasted code a joy git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8702 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug: IndVarsSimplify/2003-09-23-NotAtTop.llChris Lattner2003-09-231-2/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8689 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bugs in the last changeChris Lattner2003-09-221-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8667 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug: Inline/2003-09-22-PHINodesInNormalInvokeDest.llChris Lattner2003-09-221-2/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8666 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug: Inline/2003-09-22-PHINodesInExceptionDest.llChris Lattner2003-09-221-1/+28
| | | | | | | | ... by making sure to update PHI nodes to take into consideration the extra edges we get if we inline a call instruction through an invoke. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8664 91177308-0d34-0410-b5e6-96231b3b80d8
* Credits now go into the top-level CREDITS.TXTMisha Brukman2003-09-221-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8662 91177308-0d34-0410-b5e6-96231b3b80d8
* Credits are now in top-level CREDITS.TXTMisha Brukman2003-09-221-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8661 91177308-0d34-0410-b5e6-96231b3b80d8
* Squelch warningChris Lattner2003-09-221-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8659 91177308-0d34-0410-b5e6-96231b3b80d8
* Global variables with APPENDING linkage are very important to keep around!Chris Lattner2003-09-201-3/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8632 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename Function::getEntryNode -> getEntryBlockChris Lattner2003-09-208-10/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8625 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor cleanups, no functional changesChris Lattner2003-09-201-89/+70
| | | | | | | Rename Function::getEntryNode -> getEntryBlock git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8623 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a really obvious huge gaping bug, add a commentChris Lattner2003-09-201-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8620 91177308-0d34-0410-b5e6-96231b3b80d8
* Expose the TCE passChris Lattner2003-09-201-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8619 91177308-0d34-0410-b5e6-96231b3b80d8
* New transformation: tail recursion eliminationChris Lattner2003-09-201-0/+96
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8618 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement InstCombine/and.ll:test(15|16)Chris Lattner2003-09-191-0/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8607 91177308-0d34-0410-b5e6-96231b3b80d8
* pull a large nested conditional out into its own functionChris Lattner2003-09-191-70/+91
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8605 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement InstCombine/add.ll:test(15|16)Chris Lattner2003-09-191-0/+37
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8604 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug raising allocations whose call sites were invoke instructions.Chris Lattner2003-09-161-0/+15
| | | | | | | Thanks to brg for tracking down the problem so precisely! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8568 91177308-0d34-0410-b5e6-96231b3b80d8
* This is effectively a complete rewrite of the globaldce algorithm, resultingChris Lattner2003-09-161-177/+104
| | | | | | | | | | | | | | | | in it being both shorter and more effective. It no longer depends on the callgraph, so one FIXME has been fixed. Additionally, this pass was not able to delete recursive (but dead) functions if they were pointed to by global variables which were also dead. In fact this pass had a lot of problems deleting functions which were only pointed to by dead globals and other stuff. Fixing this means that the entire EH library should be stripped away now from programs that don't use sjlj or exceptions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8567 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor cleanups, give credit, remove code that should not be necessary, andChris Lattner2003-09-151-28/+5
| | | | | | | was a "major hack" :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8524 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial checkin of the Setjmp/Longjmp lowering/transformation pass,Chris Lattner2003-09-151-0/+501
| | | | | | | contributed by the masterful Bill Wendling! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8520 91177308-0d34-0410-b5e6-96231b3b80d8