aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Rearrange code a bitChris Lattner2004-02-241-30/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11793 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement: test/Regression/Transforms/SimplifyCFG/switch_create.llChris Lattner2004-02-241-7/+140
| | | | | | | | | | | This turns code like this: if (X == 4 | X == 7) and if (X != 4 & X != 7) into switch instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11792 91177308-0d34-0410-b5e6-96231b3b80d8
* Generate much more efficient code in programs like pifftChris Lattner2004-02-231-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11775 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a small typeo in my checkin last night that broke vortex and other ↵Chris Lattner2004-02-231-1/+1
| | | | | | programs :( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11774 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix InstCombine/2004-02-23-ShiftShiftOverflow.llChris Lattner2004-02-231-3/+10
| | | | | | | Also, turn 'shr int %X, 1234' into 'shr int %X, 31' git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11768 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement cast.ll::test14/15Chris Lattner2004-02-231-0/+37
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11742 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor some code. In the mul - setcc folding case, we really care aboutChris Lattner2004-02-231-32/+63
| | | | | | | whether this is the sign bit or not, so check unsigned comparisons as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11740 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement mul.ll:test11Chris Lattner2004-02-231-6/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11737 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement "strength reduction" of X <= C and X >= CChris Lattner2004-02-231-0/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11735 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement InstCombine/mul.ll:test10, which is a case that occurs when dealingChris Lattner2004-02-231-0/+40
| | | | | | | with "predication" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11734 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement Transforms/InstCombine/cast.ll:test13, a case which occurs in aChris Lattner2004-02-222-4/+35
| | | | | | | hot 164.gzip loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11702 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR245: Linking weak and strong global variables is dependent on link orderChris Lattner2004-02-171-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11565 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement test/Regression/Transforms/SimplifyCFG/UncondBranchToReturn.ll,Chris Lattner2004-02-161-0/+48
| | | | | | | see the testcase for the reasoning. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11496 91177308-0d34-0410-b5e6-96231b3b80d8
* Fold PHI nodes of constants which are only used by a single cast. This ↵Chris Lattner2004-02-161-0/+29
| | | | | | | | | implements phi.ll:test4 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11494 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach LLVM to unravel the "swap idiom". This implements:Chris Lattner2004-02-161-2/+13
| | | | | | | Regression/Transforms/InstCombine/xor.ll:test20 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11492 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement Transforms/InstCombine/xor.ll:test19Chris Lattner2004-02-161-2/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11490 91177308-0d34-0410-b5e6-96231b3b80d8
* Instead of producing calls to setjmp/longjmp, produce uses of theChris Lattner2004-02-151-2/+2
| | | | | | | llvm.setjmp/llvm.longjmp intrinsics. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11482 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjustments to support the new ConstantAggregateZero classChris Lattner2004-02-154-13/+30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11474 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dependence on return type of ConstantStruct::getChris Lattner2004-02-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11466 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dependence on the return type of ConstantArray::getChris Lattner2004-02-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11463 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix compilation of 126.gcc: intrinsic functions cannot throw, so they are notChris Lattner2004-02-131-28/+33
| | | | | | | | allowed in invoke instructions. Thus, if we are inlining a call to an intrinsic function into an invoke site, we don't need to turn the call into an invoke! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11384 91177308-0d34-0410-b5e6-96231b3b80d8
* Intrinsic functions cannot throwChris Lattner2004-02-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11383 91177308-0d34-0410-b5e6-96231b3b80d8
* Expose a pass ID that can be 'required'Chris Lattner2004-02-131-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11376 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove obsolete comment. Unreachable blocks will automatically be left at theChris Lattner2004-02-111-2/+0
| | | | | | | end of the function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11313 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an _embarassingly simple_ implementation of basic block layout. This isChris Lattner2004-02-111-0/+141
| | | | | | | | | more of a testcase for profiling information than anything that should reasonably be used, but it's a starting point. When I have more time I will whip this into better shape. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11311 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement SimplifyCFG/PhiEliminate.llChris Lattner2004-02-111-5/+234
| | | | | | | | Having a proper 'select' instruction would allow the elimination of a lot of the special case cruft in this patch, but we don't have one yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11307 91177308-0d34-0410-b5e6-96231b3b80d8
* The hasConstantReferences predicate always returns false.Chris Lattner2004-02-111-52/+49
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11301 91177308-0d34-0410-b5e6-96231b3b80d8
* initialization calls now return argc. If the program uses the argc valueChris Lattner2004-02-101-17/+24
| | | | | | | | passed into main, make sure they use the return value of the init call instead of the one passed in. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11262 91177308-0d34-0410-b5e6-96231b3b80d8
* Only add the global variable with the abort message if an unwind actuallyChris Lattner2004-02-091-14/+26
| | | | | | | occurs in the program. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11249 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't depend on auto data conversionChris Lattner2004-02-091-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11229 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust to the changed StructType interface. In particular, ↵Chris Lattner2004-02-094-11/+9
| | | | | | getElementTypes() is gone. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11228 91177308-0d34-0410-b5e6-96231b3b80d8
* Start using the new and improve interface to FunctionType argumentsChris Lattner2004-02-093-21/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11224 91177308-0d34-0410-b5e6-96231b3b80d8
* The ConstantExpr::getCast call can cause a CPR to be generated. If so,Chris Lattner2004-02-091-0/+4
| | | | | | | strip it off. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11213 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix grammar-o.Misha Brukman2004-02-081-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11210 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve compatibility with programs that already have a prototype for 'write',Chris Lattner2004-02-081-12/+43
| | | | | | | even if it is wierd in some way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11207 91177308-0d34-0410-b5e6-96231b3b80d8
* rename the "exceptional" destination of an invoke instruction to the ↵Chris Lattner2004-02-087-10/+10
| | | | | | 'unwind' dest git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11202 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR225: [pruneeh] -pruneeh pass removes invoke instructions it shouldn'tChris Lattner2004-02-081-10/+32
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11200 91177308-0d34-0410-b5e6-96231b3b80d8
* splitBasicBlock "does the right thing" now, no reason to reposition it.Chris Lattner2004-02-081-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11199 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement proper invoke/unwind lowering.Chris Lattner2004-02-081-21/+262
| | | | | | | This fixed PR16 "[lowerinvoke] The -lowerinvoke pass does not insert calls to setjmp/longjmp" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11195 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a call to 'write' right before the call to abort() in the unwind path.Chris Lattner2004-02-081-3/+27
| | | | | | | | This causes the JIT, or LLC'd program to print out a nice message, explaining WHY the program aborted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11184 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix another dominator update bug. These bugs keep getting exposed because GCSEChris Lattner2004-02-051-1/+1
| | | | | | | keeps finding more code motion opportunities now that the dominators are correct! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11142 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug updating dominatorsChris Lattner2004-02-051-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11140 91177308-0d34-0410-b5e6-96231b3b80d8
* Add debug outputChris Lattner2004-02-051-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11139 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR223: Loopsimplify incorrectly updates dominator informationChris Lattner2004-02-051-33/+105
| | | | | | | | | The problem is that the dominator update code didn't "realize" that it's possible for the newly inserted basic block to dominate anything. Because it IS possible, stuff was getting updated wrong. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11137 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor speedup, don't query ValueMap each time through the loopChris Lattner2004-02-041-6/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11123 91177308-0d34-0410-b5e6-96231b3b80d8
* Two changes:Chris Lattner2004-02-041-5/+12
| | | | | | | | | | | | | | 1. Don't scan to the end of alloca instructions in the caller function to insert inlined allocas, just insert at the top. This saves a lot of time inlining into functions with a lot of allocas. 2. Use splice to move the alloca instructions over, instead of remove/insert. This allows us to transfer a block at a time, and eliminates a bunch of silly symbol table manipulations. This speeds up the inliner on the testcase in PR209 from 1.73s -> 1.04s (67%) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11118 91177308-0d34-0410-b5e6-96231b3b80d8
* Optimize the case where we are inlining a function that contains only one ↵Chris Lattner2004-02-041-37/+67
| | | | | | | | | | | | basic block, and that basic block ends with a return instruction. In this case, we can just splice the cloned "body" of the function directly into the source basic block, avoiding a lot of rearrangement and splitBasicBlock's linear scan over the split block. This speeds up the inliner on the testcase in PR209 from 2.3s to 1.7s, a 35% reduction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11116 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust to the new BasicBlock ctor, which requires a function parameterChris Lattner2004-02-042-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11114 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unneeded code now that splitBasicBlock does the "right thing"Chris Lattner2004-02-041-5/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11111 91177308-0d34-0410-b5e6-96231b3b80d8
* More refactoring. Move alloca instructions and handle invoke instructionsChris Lattner2004-02-041-129/+132
| | | | | | | | before we delete the original call site, allowing slight simplifications of code, but nothing exciting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11109 91177308-0d34-0410-b5e6-96231b3b80d8