summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* ShiftAmt might equal to zero. Handle this situation.Zhou Sheng2007-03-141-7/+9
| | | | llvm-svn: 35094
* Enable KnownZero/One.clear().Zhou Sheng2007-03-141-2/+2
| | | | llvm-svn: 35093
* Correct type info for isLegalAddressImmediate() check.Evan Cheng2007-03-131-12/+18
| | | | llvm-svn: 35086
* ifdef out some dead code.Chris Lattner2007-03-131-2/+8
| | | | | | Fix PR1244 and Transforms/InstCombine/2007-03-13-CompareMerge.ll llvm-svn: 35082
* For expression likeZhou Sheng2007-03-131-3/+3
| | | | | | | | "APInt::getAllOnesValue(ShiftAmt).zextOrCopy(BitWidth)", to handle ShiftAmt == BitWidth situation, use zextOrCopy() instead of zext(). llvm-svn: 35080
* In APInt version ComputeMaskedBits():Zhou Sheng2007-03-131-15/+28
| | | | | | | 1. Ensure VTy, KnownOne and KnownZero have same bitwidth. 2. Make code more efficient. llvm-svn: 35078
* Use new TargetLowering addressing modes hooks.Evan Cheng2007-03-121-20/+18
| | | | llvm-svn: 35072
* Unbreak VC++ build. Do not use identifiers starting with _ as they are ↵Jeff Cohen2007-03-121-3/+3
| | | | | | | | reserved and can collide with system defined names. Windows defines _BB, for example. llvm-svn: 35066
* Add an APInt version of SimplifyDemandedBits.Reid Spencer2007-03-121-1/+524
| | | | | | Patch by Zhou Sheng. llvm-svn: 35064
* Add an APInt version of ShrinkDemandedConstant.Reid Spencer2007-03-121-0/+24
| | | | | | Patch by Zhou Sheng. llvm-svn: 35063
* Avoid to assert on "(KnownZero & KnownOne) == 0".Zhou Sheng2007-03-121-1/+1
| | | | llvm-svn: 35062
* In function ComputeMaskedBits():Zhou Sheng2007-03-121-6/+6
| | | | | | | | 1. Replace getSignedMinValue() with getSignBit() for better code readability. 2. Replace APIntOps::shl() with operator<<= for convenience. 3. Make APInt construction more effective. llvm-svn: 35060
* Add value ranges. Currently inefficient in both execution time andNick Lewycky2007-03-101-219/+397
| | | | | | optimization power. llvm-svn: 35058
* Use range tests in LowerSwitch, where possibleAnton Korobeynikov2007-03-101-31/+114
| | | | llvm-svn: 35057
* Remove dead comments.Devang Patel2007-03-091-3/+0
| | | | llvm-svn: 35053
* Avoid recursion. Use iterative algorithm for RenamePass().Devang Patel2007-03-091-4/+31
| | | | llvm-svn: 35052
* Increment iterator now because IVUseShouldUsePostIncValue may removeDevang Patel2007-03-091-2/+6
| | | | | | User from the list of I users. llvm-svn: 35051
* Fix a bug in function ComputeMaskedBits().Zhou Sheng2007-03-081-2/+2
| | | | llvm-svn: 35027
* This appears correct, enable it so we can see perf changes on testersChris Lattner2007-03-081-1/+1
| | | | llvm-svn: 35024
* Second half of PR1226. This is currently still disabled, until I have a ↵Chris Lattner2007-03-081-9/+67
| | | | | | | | chance to do the correctness/performance analysis testing. llvm-svn: 35023
* Fix a bug in APIntified ComputeMaskedBits().Zhou Sheng2007-03-081-8/+4
| | | | llvm-svn: 35022
* For PR1205:Reid Spencer2007-03-081-0/+10
| | | | | | | | | | Provide an APIntified version of MaskedValueIsZero. This will (temporarily) cause a "defined but not used" message from the compiler. It will be used in the next patch in this series. Patch by Sheng Zhou. llvm-svn: 35019
* For PR1205:Reid Spencer2007-03-081-1/+206
| | | | | | | | Add a new ComputeMaskedBits function that is APIntified. We'll slowly convert things over to use this version. When its all done, we'll remove the existing version. llvm-svn: 35018
* Now IndVarSimplify is a LoopPass.Devang Patel2007-03-071-27/+32
| | | | llvm-svn: 35003
* Now LICM is a LoopPass.Devang Patel2007-03-071-30/+26
| | | | llvm-svn: 35001
* Now LoopUnroll is a LoopPass.Devang Patel2007-03-071-36/+7
| | | | llvm-svn: 34996
* Now LoopUnswitch is a LoopPass.Devang Patel2007-03-071-86/+17
| | | | llvm-svn: 34992
* Now LoopStrengthReduce is a LoopPass.Devang Patel2007-03-061-23/+14
| | | | llvm-svn: 34984
* Remove an unnecessary if statement and adjust indentation.Reid Spencer2007-03-051-23/+21
| | | | llvm-svn: 34939
* This is the first major step of implementing PR1226. We now successfullyChris Lattner2007-03-051-5/+156
| | | | | | | scalarrepl things down to elements, but mem2reg can't promote elements that are memset/memcpy'd. Until then, the code is disabled "0 &&". llvm-svn: 34924
* 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
OpenPOWER on IntegriCloud