summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* fix a subtle bug that caused an MSVC warning. Thanks to Jeffc for pointing ↵Chris Lattner2007-03-051-2/+3
| | | | | | this out. llvm-svn: 34920
* Add some simplifications for demanded bits, this allows instcombine to turn:Chris Lattner2007-03-051-0/+31
| | | | | | | | | | | | | | | | | | | | | define i64 @test(i64 %A, i32 %B) { %tmp12 = zext i32 %B to i64 ; <i64> [#uses=1] %tmp3 = shl i64 %tmp12, 32 ; <i64> [#uses=1] %tmp5 = add i64 %tmp3, %A ; <i64> [#uses=1] %tmp6 = and i64 %tmp5, 123 ; <i64> [#uses=1] ret i64 %tmp6 } into: define i64 @test(i64 %A, i32 %B) { %tmp6 = and i64 %A, 123 ; <i64> [#uses=1] ret i64 %tmp6 } This implements Transforms/InstCombine/add2.ll:test1 llvm-svn: 34919
* Unbreak VC++ build.Jeff Cohen2007-03-053-1/+3
| | | | llvm-svn: 34917
* simplify some codeChris Lattner2007-03-041-18/+17
| | | | llvm-svn: 34914
* minor cleanupsChris Lattner2007-03-041-7/+8
| | | | llvm-svn: 34904
* Speed up -instcombine by 20% by avoiding a particularly expensive passmgr call.Chris Lattner2007-03-041-1/+4
| | | | llvm-svn: 34902
* switch MarkAliveBlocks over to using SmallPtrSet instead of std::set, speedingChris Lattner2007-03-041-5/+5
| | | | | | up simplifycfg by 20% llvm-svn: 34901
* make better use of LCSSA information in RewriteLoopExitValues. Before, weChris Lattner2007-03-041-67/+76
| | | | | | | | | | | would scan the entire loop body, then scan all users of instructions in the loop, looking for users outside the loop. Now, since we know that the loop is in LCSSA form, we know that any users outside the loop will be LCSSA phi nodes. Just scan them. This speeds up indvars significantly. llvm-svn: 34898
* Implement PR1179/PR1232 and ↵Chris Lattner2007-03-041-46/+26
| | | | | | | | test/Transforms/IndVarsSimplify/loop_evaluate_[234].ll This makes -indvars require and use LCSSA, updating it as appropriate. llvm-svn: 34896
* Make RewriteLoopExitValues far less nested by using continue in the loopChris Lattner2007-03-031-91/+94
| | | | llvm-svn: 34891
* my recent change caused a failure in a bswap testcase, because it changedChris Lattner2007-03-031-48/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the order that instcombine processed instructions in the testcase. The end result is that instcombine finished with: define i16 @test1(i16 %a) { %tmp = zext i16 %a to i32 ; <i32> [#uses=2] %tmp21 = lshr i32 %tmp, 8 ; <i32> [#uses=1] %tmp5 = shl i32 %tmp, 8 ; <i32> [#uses=1] %tmp.upgrd.32 = or i32 %tmp21, %tmp5 ; <i32> [#uses=1] %tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16 ; <i16> [#uses=1] ret i16 %tmp.upgrd.3 } which can't get matched as a bswap. This patch makes instcombine more sophisticated about removing truncating casts, allowing it to turn this into: define i16 @test2(i16 %a) { %tmp211 = lshr i16 %a, 8 %tmp52 = shl i16 %a, 8 %tmp.upgrd.323 = or i16 %tmp211, %tmp52 ret i16 %tmp.upgrd.323 } which then matches as bswap. This fixes bswap.ll and implements InstCombine/cast2.ll:test[12]. This also implements cast elimination of add/sub. llvm-svn: 34870
* Translate bit operations to English.Nick Lewycky2007-03-031-1/+2
| | | | llvm-svn: 34868
* add a top-level iteration loop to instcombine. This means that it will neverChris Lattner2007-03-031-4/+21
| | | | | | finish without combining something it is capable of. llvm-svn: 34865
* APIntify this pass.Reid Spencer2007-03-031-28/+36
| | | | llvm-svn: 34863
* Finally get this patch right :)Reid Spencer2007-03-021-5/+5
| | | | | | Replace expensive getZExtValue() == 0 calls with isZero() calls. llvm-svn: 34861
* Dang, I've done that twice now! Undo previous commit.Reid Spencer2007-03-021-12/+11
| | | | llvm-svn: 34860
* Use more efficient test for one value in a ConstantInt.Reid Spencer2007-03-022-13/+14
| | | | llvm-svn: 34859
* Guard against huge loop trip counts in an APInt safe way.Reid Spencer2007-03-021-2/+7
| | | | llvm-svn: 34858
* Make sure debug code is not evaluated in non-debug case.Reid Spencer2007-03-021-2/+3
| | | | llvm-svn: 34856
* 1. Sort switch cases using APInt safe comparison.Reid Spencer2007-03-021-2/+2
| | | | | | 2. Make sure debug output of APInt values is safe for all bit widths. llvm-svn: 34855
* Use APInt safe isOne() method on ConstantInt instead of getZExtValue()==1Reid Spencer2007-03-021-1/+1
| | | | llvm-svn: 34854
* Make sorting of ConstantInt be APInt clean through use of ult function.Reid Spencer2007-03-021-1/+1
| | | | llvm-svn: 34853
* Fix a significant algorithm problem with the instcombine worklist. removingChris Lattner2007-03-021-54/+70
| | | | | | | | | | a value from the worklist required scanning the entire worklist to remove all entries. We now use a combination map+vector to prevent duplicates from happening and prevent the scan. This speeds up instcombine on a large file from the llvm-gcc bootstrap from 189.7s to 4.84s in a debug build and from 5.04s to 1.37s in a release build. llvm-svn: 34848
* minor cleanupChris Lattner2007-03-021-6/+2
| | | | llvm-svn: 34846
* switch the inliner from being recursive to being iterative.Chris Lattner2007-03-021-6/+14
| | | | llvm-svn: 34832
* Reverse a premature commital.Reid Spencer2007-03-021-21/+17
| | | | llvm-svn: 34822
* Prefer non-virtual calls to ConstantInt::isZero over virtual calls toReid Spencer2007-03-026-29/+33
| | | | | | Constant::isNullValue() in situations where it is possible. llvm-svn: 34821
* Although probably not necessary, guard against a potential assertion byReid Spencer2007-03-011-1/+1
| | | | | | using isNullValue() instead of getZExtValue() == 0. llvm-svn: 34815
* Use isUnitValue() instead of getZExtValue() == 1 which will prevent anReid Spencer2007-03-011-1/+1
| | | | | | assert if the ConstantInt's value is large. llvm-svn: 34814
* Use APInt conversion to string so the result is correct regardless of theReid Spencer2007-03-011-1/+1
| | | | | | bit width of the ConstantInt being converted. llvm-svn: 34810
* The 64-bit constructor for ConstantInt changes from int64_t to uint64_t.Reid Spencer2007-03-011-1/+1
| | | | | | | This caused a warning for construction with -1. Avoid the warning by using -1ULL instead. llvm-svn: 34796
* Remove the "isSigned" parameters from ConstantRange. It turns out theyReid Spencer2007-03-011-6/+5
| | | | | | | | are not needed as the results are the same with or without it. Patch by Nicholas Lewycky. llvm-svn: 34782
* For PR1205:Reid Spencer2007-02-281-9/+15
| | | | | | Adjust to changes in ConstantRange interface. llvm-svn: 34762
* For PR1205:Reid Spencer2007-02-281-1/+4
| | | | | | | Remove ConstantInt from ConstantRange interface and adjust its users to compensate. llvm-svn: 34758
* For PR1205:Reid Spencer2007-02-281-4/+5
| | | | | | | First round of ConstantRange changes. This makes all CR constructors use only APInt and not use ConstantInt. Clients are adjusted accordingly. llvm-svn: 34756
* Use efficient container SmallPtrSetDevang Patel2007-02-261-3/+4
| | | | llvm-svn: 34640
* Do not unswitch loop on same value again and again.Devang Patel2007-02-261-0/+7
| | | | llvm-svn: 34638
* Fix InstCombine/2007-02-23-PhiFoldInfLoop.ll and PR1217Chris Lattner2007-02-241-1/+2
| | | | llvm-svn: 34546
* fix an obscure and tricky bug the inliner can hit sometimes.Chris Lattner2007-02-231-1/+1
| | | | llvm-svn: 34531
* Revert changes for a simplier solution.Jim Laskey2007-02-221-50/+36
| | | | llvm-svn: 34495
* Itanium ABI exception handing support.Jim Laskey2007-02-211-36/+50
| | | | llvm-svn: 34480
* Fix typos in comments.Dan Gohman2007-02-201-1/+1
| | | | llvm-svn: 34456
* remove reoptimizer-specific passesChris Lattner2007-02-202-206/+0
| | | | llvm-svn: 34439
* eliminate use of deprecated apisChris Lattner2007-02-193-5/+8
| | | | llvm-svn: 34417
* fix commentChris Lattner2007-02-181-1/+1
| | | | llvm-svn: 34395
* simplify pass, delete dead gvar protos as well.Chris Lattner2007-02-181-16/+21
| | | | llvm-svn: 34394
* convert more vectors to smallvectors, 2.8% speedupChris Lattner2007-02-151-3/+3
| | | | llvm-svn: 34333
* change some vectors to smallvectors. This speeds up instcombine on 447.dealIIChris Lattner2007-02-151-3/+3
| | | | | | by 5%. llvm-svn: 34332
* switch an std::set to a SmallPtr set, this speeds up instcombine by 9.5%Chris Lattner2007-02-151-3/+4
| | | | | | on 447.dealII llvm-svn: 34323
* For PR1195:Reid Spencer2007-02-152-10/+10
| | | | | | | Change use of "packed" term to "vector" in comments, strings, variable names, etc. llvm-svn: 34300
OpenPOWER on IntegriCloud