summaryrefslogtreecommitdiff
path: root/lib/Transforms
Commit message (Collapse)AuthorAge
...
* 1. Avoid unnecessary APInt construction if possible.Zhou Sheng2007-03-25
| | | | | | | | 2. Use isStrictlyPositive() instead of isPositive() in two places where they need APInt value > 0 not only >=0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35333 91177308-0d34-0410-b5e6-96231b3b80d8
* Make more uses of getHighBitsSet and get rid of some pointless & of anReid Spencer2007-03-25
| | | | | | | APInt with its type mask. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35325 91177308-0d34-0410-b5e6-96231b3b80d8
* More APIntification:Reid Spencer2007-03-25
| | | | | | | | | | | | | | | | * Convert the last use of a uint64_t that should have been an APInt. * Change ComputeMaskedBits to have a const reference argument for the Mask so that recursions don't cause unneeded temporaries. This causes temps to be needed in other places (where the mask has to change) but this change optimizes for the recursion which is more frequent. * Remove two instances of &ing a Mask with getAllOnesValue. Its not needed any more because APInt is accurate in its bit computations. * Start using the getLowBitsSet and getHighBits set methods on APInt instead of shifting. This makes it more clear in the code what is going on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35321 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a regression on vector or instructions.Chris Lattner2007-03-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35314 91177308-0d34-0410-b5e6-96231b3b80d8
* Make some codes more efficient.Zhou Sheng2007-03-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35297 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1205:Reid Spencer2007-03-24
| | | | | | | | Convert some calls to ConstantInt::getZExtValue() into getValue() and use APInt facilities in the subsequent computations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35294 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1205:Reid Spencer2007-03-23
| | | | | | | | | | | | | * APIntify visitAdd and visitSelectInst * Remove unused uint64_t versions of utility functions that have been replaced with APInt versions. This completes most of the changes for APIntification of InstCombine. This passes llvm-test and llvm/test/Transforms/InstCombine/APInt. Patch by Zhou Sheng. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35287 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1205:Reid Spencer2007-03-23
| | | | | | | | | APIntify visitDiv, visitMul and visitRem. Patch by Zhou Sheng. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35283 91177308-0d34-0410-b5e6-96231b3b80d8
* switch AddReachableCodeToWorklist from being recursive to being iterative.Chris Lattner2007-03-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35282 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1205:Reid Spencer2007-03-23
| | | | | | | | | | APIntify several utility functions supporting logical operators and shift operators. Patch by Zhou Sheng. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35281 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the "KnownZero ^ TypeMask" computation just once.Zhou Sheng2007-03-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35276 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the code.Zhou Sheng2007-03-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35275 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1205:Reid Spencer2007-03-22
| | | | | | | | | APInt support for logical operators in visitAnd, visitOr, and visitXor. Patch by Zhou Sheng. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35273 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1205:Reid Spencer2007-03-22
| | | | | | | | | | | * APIntify commonIntCastTransforms * APIntify visitTrunc * APIntify visitZExt Patch by Zhou Sheng. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35271 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1205:Reid Spencer2007-03-22
| | | | | | | | | * Re-enable the APInt version of MaskedValueIsZero. * APIntify the Comput{Un}SignedMinMaxValuesFromKnownBits functions * APIntify visitICmpInst. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35270 91177308-0d34-0410-b5e6-96231b3b80d8
* Change uses of Function::front to Function::getEntryBlock for readability.Dan Gohman2007-03-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35265 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix broken optimization disabled by a logic bug.Nick Lewycky2007-03-22
| | | | | | | | | | Analyze GEPs. If the indices are all zero, transfer whether the pointer is known to be not null through the GEP. Add a few more cases for xor and shift instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35257 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1248:Reid Spencer2007-03-21
| | | | | | | | | | | | | * Fix some indentation and comments in InsertRangeTest * Add an "IsSigned" parameter to AddWithOverflow and make it handle signed additions. Also, APIntify this function so it works with any bitwidth. * For the icmp pred ([us]div %X, C1), C2 transforms, exit early if the div instruction's RHS is zero. * Finally, for icmp pred (sdiv %X, C1), -C2, fix an off-by-one error. The HiBound needs to be incremented in order to get the range test correct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35247 91177308-0d34-0410-b5e6-96231b3b80d8
* do not share old induction variables when this would result in invalidDale Johannesen2007-03-20
| | | | | | | instructions (that would have to be split later) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35227 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some VC++ warnings.Jeff Cohen2007-03-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35224 91177308-0d34-0410-b5e6-96231b3b80d8
* LoopSimplify::FindPHIToPartitionLoops()Devang Patel2007-03-20
| | | | | | | Use ETForest instead of DominatorSet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35221 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify isHighOnes().Zhou Sheng2007-03-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35211 91177308-0d34-0410-b5e6-96231b3b80d8
* use types of loads and stores, not address, in CheckForIVReuseDale Johannesen2007-03-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35197 91177308-0d34-0410-b5e6-96231b3b80d8
* Make isOneBitSet faster by using APInt::isPowerOf2. Thanks Chris.Reid Spencer2007-03-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35194 91177308-0d34-0410-b5e6-96231b3b80d8
* APIntify the isHighOnes utility function.Reid Spencer2007-03-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35190 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement isMaxValueMinusOne in terms of APInt instead of uint64_t.Reid Spencer2007-03-19
| | | | | | | Patch by Sheng Zhou. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35188 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement isMinValuePlusOne using facilities of APInt instead of uint64_tReid Spencer2007-03-19
| | | | | | | Patch by Zhou Sheng. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35187 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement isOneBitSet in terms of APInt::countPopulation.Reid Spencer2007-03-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35186 91177308-0d34-0410-b5e6-96231b3b80d8
* 1. Use APInt::getSignBit to reduce clutter (patch by Sheng Zhou)Reid Spencer2007-03-19
| | | | | | | 2. Replace uses of the "isPositive" utility function with APInt::isPositive git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35185 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a redundant clause in an if statement.Reid Spencer2007-03-19
| | | | | | | Patch by Sheng Zhou. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35184 91177308-0d34-0410-b5e6-96231b3b80d8
* fix ScalarRepl/2007-03-19-CanonicalizeMemcpy.llChris Lattner2007-03-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35169 91177308-0d34-0410-b5e6-96231b3b80d8
* implement the next chunk of SROA with memset/memcpy's of aggregates. ThisChris Lattner2007-03-19
| | | | | | | implements Transforms/ScalarRepl/memset-aggregate-byte-leader.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35150 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up this code and fix subtract miscompile.Nick Lewycky2007-03-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35146 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement InstCombine/and-xor-merge.ll:test[12].Chris Lattner2007-03-18
| | | | | | | Rearrange some code to simplify it now that shifts are binops git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35145 91177308-0d34-0410-b5e6-96231b3b80d8
* Propagate ValueRanges across equality.Nick Lewycky2007-03-18
| | | | | | | Add some more micro-optimizations: x * 0 = 0, a - x = a --> x = 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35138 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence warningAnton Korobeynikov2007-03-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35137 91177308-0d34-0410-b5e6-96231b3b80d8
* Add more comments and update to new asm syntax.Nick Lewycky2007-03-16
| | | | | | | | | | | Add new micro-optimizations. Add icmp predicate snuggling. Given %x ULT 4, "icmp ugt %x, 2" becomes "icmp eq %x, 3". This doesn't apply in any non-trivial cases yet due to missing support for NE values in ValueRanges. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35119 91177308-0d34-0410-b5e6-96231b3b80d8
* ShiftAmt might equal to zero. Handle this situation.Zhou Sheng2007-03-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35094 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable KnownZero/One.clear().Zhou Sheng2007-03-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35093 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct type info for isLegalAddressImmediate() check.Evan Cheng2007-03-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35086 91177308-0d34-0410-b5e6-96231b3b80d8
* ifdef out some dead code.Chris Lattner2007-03-13
| | | | | | | Fix PR1244 and Transforms/InstCombine/2007-03-13-CompareMerge.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35082 91177308-0d34-0410-b5e6-96231b3b80d8
* For expression likeZhou Sheng2007-03-13
| | | | | | | | | "APInt::getAllOnesValue(ShiftAmt).zextOrCopy(BitWidth)", to handle ShiftAmt == BitWidth situation, use zextOrCopy() instead of zext(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35080 91177308-0d34-0410-b5e6-96231b3b80d8
* In APInt version ComputeMaskedBits():Zhou Sheng2007-03-13
| | | | | | | | 1. Ensure VTy, KnownOne and KnownZero have same bitwidth. 2. Make code more efficient. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35078 91177308-0d34-0410-b5e6-96231b3b80d8
* Use new TargetLowering addressing modes hooks.Evan Cheng2007-03-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35072 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak VC++ build. Do not use identifiers starting with _ as they are ↵Jeff Cohen2007-03-12
| | | | | | | | | reserved and can collide with system defined names. Windows defines _BB, for example. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35066 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an APInt version of SimplifyDemandedBits.Reid Spencer2007-03-12
| | | | | | | Patch by Zhou Sheng. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35064 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an APInt version of ShrinkDemandedConstant.Reid Spencer2007-03-12
| | | | | | | Patch by Zhou Sheng. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35063 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid to assert on "(KnownZero & KnownOne) == 0".Zhou Sheng2007-03-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35062 91177308-0d34-0410-b5e6-96231b3b80d8
* In function ComputeMaskedBits():Zhou Sheng2007-03-12
| | | | | | | | | 1. Replace getSignedMinValue() with getSignBit() for better code readability. 2. Replace APIntOps::shl() with operator<<= for convenience. 3. Make APInt construction more effective. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35060 91177308-0d34-0410-b5e6-96231b3b80d8
* Add value ranges. Currently inefficient in both execution time andNick Lewycky2007-03-10
| | | | | | | optimization power. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35058 91177308-0d34-0410-b5e6-96231b3b80d8