summaryrefslogtreecommitdiff
path: root/lib/Transforms
Commit message (Collapse)AuthorAge
* Added LLVM copyright notice to Makefiles.John Criswell2003-10-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9312 91177308-0d34-0410-b5e6-96231b3b80d8
* Added LLVM project notice to the top of every C++ source file.John Criswell2003-10-20
| | | | | | | Header files will be on the way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
* Reorder for minor efficiency gainChris Lattner2003-10-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9285 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the Opcode enum for PHI nodes from "Instruction::PHINode" to ↵Chris Lattner2003-10-19
| | | | | | "Instruction::PHI" to be more consistent with the other instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9269 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR#50Chris Lattner2003-10-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9227 91177308-0d34-0410-b5e6-96231b3b80d8
* ADd support for the new varargs instructionsChris Lattner2003-10-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9225 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not crash on empty structuresChris Lattner2003-10-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9195 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for 'weak' linkage.Chris Lattner2003-10-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9171 91177308-0d34-0410-b5e6-96231b3b80d8
* This code does not require random access use_listsChris Lattner2003-10-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9156 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate using declarationChris Lattner2003-10-16
| | | | | | | Rewrite code to work with use_lists what are either random access or bidirectional git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9155 91177308-0d34-0410-b5e6-96231b3b80d8
* Decrease usage of use_size()Chris Lattner2003-10-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9135 91177308-0d34-0410-b5e6-96231b3b80d8
* CleanupChris Lattner2003-10-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9133 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not move variable sized allocations to the top of the caller, which mightChris Lattner2003-10-14
| | | | | | | | | break dominance relationships, and is otherwise bad. This fixes bug: Inline/2003-10-13-AllocaDominanceProblem.ll. This also fixes miscompilation of 3 176.gcc source files (reload1.c, global.c, flow.c) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9109 91177308-0d34-0410-b5e6-96231b3b80d8
* Whoops, we inserted into the wrong set. What's up with the dead set anyway?Chris Lattner2003-10-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9094 91177308-0d34-0410-b5e6-96231b3b80d8
* Use external df iterators to avoid revisiting blocks in functions withChris Lattner2003-10-13
| | | | | | | multiple setjmp calls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9093 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap code at 80 columnsChris Lattner2003-10-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9073 91177308-0d34-0410-b5e6-96231b3b80d8
* Regularize header file commentsChris Lattner2003-10-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9071 91177308-0d34-0410-b5e6-96231b3b80d8
* Regularize header file comment, eliminate using'sChris Lattner2003-10-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9069 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor cleanupsChris Lattner2003-10-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9067 91177308-0d34-0410-b5e6-96231b3b80d8
* Checkin an improvement contributed by Bill:Chris Lattner2003-10-13
| | | | | | | | | | | | Only transform call sites in a setjmp'ing function which are reachable from the setjmp. If the call dominates the setjmp (for example), the called function cannot longjmp to the setjmp. This dramatically reduces the number of invoke instructions created in some large testcases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9066 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support to the loop canonicalization pass to make it transform loops toChris Lattner2003-10-13
| | | | | | | | | have a SINGLE backedge. This is useful to, for example, the -indvars pass. This implements testcase LoopSimplify/single-backedge.ll and closes PR#34 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9065 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename loop preheaders pass to loop simplifyChris Lattner2003-10-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9061 91177308-0d34-0410-b5e6-96231b3b80d8
* File is renamed to LoopSimplify.cppChris Lattner2003-10-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9059 91177308-0d34-0410-b5e6-96231b3b80d8
* First step in renaming the preheaders pass to loopsimplifyChris Lattner2003-10-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9058 91177308-0d34-0410-b5e6-96231b3b80d8
* The preheader insertion pass only depends on the CFG. Mark it as such, whichChris Lattner2003-10-12
| | | | | | | allows GCCAS to only run it once. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9056 91177308-0d34-0410-b5e6-96231b3b80d8
* Include <cstdio> instead of <stdio.h>.Brian Gaeke2003-10-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9032 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't include Config/stdio.h or <stdio.h>.Brian Gaeke2003-10-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9031 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix spelling.Misha Brukman2003-10-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9027 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixing the spelling of this filename.Misha Brukman2003-10-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9009 91177308-0d34-0410-b5e6-96231b3b80d8
* Update commentChris Lattner2003-10-08
| | | | 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-08
| | | | | | | | 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-08
| | | | 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-08
| | | | | | | | | 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-07
| | | | 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-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8954 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor code a bitChris Lattner2003-10-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8952 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bugzilla bug #5Chris Lattner2003-10-07
| | | | 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-07
| | | | | | | 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-07
| | | | 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-06
| | | | 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-06
| | | | | | | | | | | | | | | | | 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-06
| | | | | | | | | | | 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-05
| | | | | | | | | | | | | | | | | | | | | "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-05
| | | | 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-05
| | | | | | | | | | | | | | | | | | | | | | | | 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-05
| | | | | | | 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-05
| | | | 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-05
| | | | 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-05
| | | | | | 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-05
| | | | | | | | | | | | | | *** 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