summaryrefslogtreecommitdiff
path: root/lib/Transforms
Commit message (Collapse)AuthorAge
...
* Fix a bug I introduced with my patch yesterday which broke Qt (I convertedChris Lattner2007-04-03
| | | | | | | | | some constant exprs to apints). Thanks to Anton for tracking down a small testcase that triggered this! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35633 91177308-0d34-0410-b5e6-96231b3b80d8
* reinstate the previous two patches, with a bugfix :)Chris Lattner2007-04-03
| | | | | | | ldecod now passes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35626 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting back to 1.723. The last two commits broke JM (and possibily ↵Evan Cheng2007-04-03
| | | | | | others) on ARM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35620 91177308-0d34-0410-b5e6-96231b3b80d8
* split some code out into a helper functionChris Lattner2007-04-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35615 91177308-0d34-0410-b5e6-96231b3b80d8
* Split a whole ton of code out of visitICmpInst into ↵Chris Lattner2007-04-03
| | | | | | visitICmpInstWithInstAndIntCst. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35614 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR1253 and xor2.ll:test[01]Chris Lattner2007-04-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35612 91177308-0d34-0410-b5e6-96231b3b80d8
* allow -1 strides to reuse "1" strides.Chris Lattner2007-04-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35607 91177308-0d34-0410-b5e6-96231b3b80d8
* 1. Make use of APInt operation instead of using ConstantExpr::getXXX.Zhou Sheng2007-04-02
| | | | | | | 2. Use cheaper APInt methods. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35594 91177308-0d34-0410-b5e6-96231b3b80d8
* Use uint32_t for bitwidth instead of unsigned.Zhou Sheng2007-04-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35593 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass the type of the store access, not the type of the store, into theChris Lattner2007-04-02
| | | | | | | | | | | | | | | | | | | | | | | | | | target hook. This allows us to codegen a loop as: LBB1_1: @cond_next mov r2, #0 str r2, [r0, +r3, lsl #2] add r3, r3, #1 cmn r3, #1 bne LBB1_1 @cond_next instead of: LBB1_1: @cond_next mov r2, #0 str r2, [r0], #+4 add r3, r3, #1 cmn r3, #1 bne LBB1_1 @cond_next This looks the same, but has one fewer induction variable (and therefore, one fewer register) live in the loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35592 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap long lineChris Lattner2007-04-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35588 91177308-0d34-0410-b5e6-96231b3b80d8
* use more obvious function name.Chris Lattner2007-04-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35587 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify (x+c)^signbit as (x+c+signbit), pointed out by PR1288. This implementsChris Lattner2007-04-02
| | | | | | | test/Transforms/InstCombine/xor.ll:test28 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35584 91177308-0d34-0410-b5e6-96231b3b80d8
* reduce use of std::setChris Lattner2007-04-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35576 91177308-0d34-0410-b5e6-96231b3b80d8
* Various passes before isel split edges and do other CFG-restructuring changes.Chris Lattner2007-04-02
| | | | | | | | | | | | | | | | isel has its own particular features that it wants in the CFG, in order to reduce the number of times a constant is computed, etc. Make sure that we clean up the CFG before doing any other things for isel. Doing so can dramatically reduce the number of split edges and reduce the number of places that constants get computed. For example, this shrinks CodeGen/Generic/phi-immediate-factoring.ll from 44 to 37 instructions on X86, and from 21 to 17 MBB's in the output. This is primarily a code size win, not a performance win. This implements CodeGen/Generic/phi-immediate-factoring.ll and PR1296. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35575 91177308-0d34-0410-b5e6-96231b3b80d8
* print the type of an inserted IV in -debug mode.Chris Lattner2007-04-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35563 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify this code, make it work for ap intsChris Lattner2007-04-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35561 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid unnecessary APInt construction.Zhou Sheng2007-04-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35555 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1297:Reid Spencer2007-04-01
| | | | | | | Support overloaded intrinsics bswap, ctpop, cttz, ctlz. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35547 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix InstCombine/2007-03-31-InfiniteLoop.llChris Lattner2007-04-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35536 91177308-0d34-0410-b5e6-96231b3b80d8
* Split the sdisel code munging stuff out into its own opt-pass, CodeGenPrepare.Chris Lattner2007-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35528 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete dead code.Zhou Sheng2007-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35525 91177308-0d34-0410-b5e6-96231b3b80d8
* Use APInt operators to calculate the carry bits, remove this loop.Zhou Sheng2007-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35524 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure the use of ConstantInt::getZExtValue() for shift amount safe.Zhou Sheng2007-03-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35510 91177308-0d34-0410-b5e6-96231b3b80d8
* 1. Make sure the use of ConstantInt::getZExtValue() for getting shiftZhou Sheng2007-03-30
| | | | | | | | | amount is safe. 2. Use new method on ConstantInt instead of (? :) operator. 3. Use new method uge() on ConstantInt to simplify codes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35505 91177308-0d34-0410-b5e6-96231b3b80d8
* Use APInt operation instead of ConstantExpr::getXX.Zhou Sheng2007-03-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35503 91177308-0d34-0410-b5e6-96231b3b80d8
* 1. Make more use of APInt::getHighBitsSet/getLowBitsSet.Zhou Sheng2007-03-29
| | | | | | | | 2. Let APInt variable do the binary operation stuff instead of using ConstantExpr::getXXX. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35450 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up some codes in InstCombiner::SimplifyDemandedBits().Zhou Sheng2007-03-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35446 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up codes in InstCombiner::SimplifyDemandedBits():Zhou Sheng2007-03-29
| | | | | | | | | 1. Line out nested call of APInt::zext/trunc. 2. Make more use of APInt::getHighBitsSet/getLowBitsSet. 3. Use APInt[] operator instead of expression like "APIntVal & SignBit". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35444 91177308-0d34-0410-b5e6-96231b3b80d8
* 1. Make the APInt variable do the binary operation stuff if possibleZhou Sheng2007-03-29
| | | | | | | | | instead of using ConstantExpr::getXX. 2. Use constant reference to APInt if possible instead of expensive APInt copy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35443 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid unnecessary APInt construction.Zhou Sheng2007-03-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35431 91177308-0d34-0410-b5e6-96231b3b80d8
* 1. Make more use of getLowBitsSet/getHighBitsSet.Zhou Sheng2007-03-28
| | | | | | | | | 2. Use APInt[] instead of "X & SignBit". 3. Clean up some codes. 4. Make the expression like "ShiftAmt = ShiftAmtC->getZExtValue()" safe. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35424 91177308-0d34-0410-b5e6-96231b3b80d8
* 1. Make more use of getLowBitsSet/getHighBitsSet.Zhou Sheng2007-03-28
| | | | | | | | 2. Make the APInt value do the zext/trunc stuff instead of using ConstantExpr::getZExt(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35422 91177308-0d34-0410-b5e6-96231b3b80d8
* Use UnknownBIts[BitWidth-1] instead of UnknownBIts & SignBits.Zhou Sheng2007-03-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35418 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused APInt variable.Zhou Sheng2007-03-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35414 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up codes in ComputeMaskedBits():Zhou Sheng2007-03-28
| | | | | | | | | 1. Line out nested use of zext/trunc. 2. Make more use of getHighBitsSet/getLowBitsSet. 3. Use APInt[] != 0 instead of "(APInt & SignBit) != 0". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35408 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1280:Reid Spencer2007-03-28
| | | | | | | | When converting an add/xor/and triplet into a trunc/sext, only do so if the intermediate integer type is a bitwidth that the targets can handle. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35400 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreaks non-debug builds.Evan Cheng2007-03-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35383 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement some minor review feedback.Reid Spencer2007-03-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35373 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1271:Reid Spencer2007-03-26
| | | | | | | Fix another incorrectly converted shift mask. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35371 91177308-0d34-0410-b5e6-96231b3b80d8
* Reduce malloc/free traffic.Devang Patel2007-03-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35370 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate use of std::setChris Lattner2007-03-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35361 91177308-0d34-0410-b5e6-96231b3b80d8
* Get better debug output by having modified instructions print both theReid Spencer2007-03-26
| | | | | | | | | original and new instruction. A slight performance hit with ostringstream but it is only for debug. Also, clean up an uninitialized variable warning noticed in a release build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35358 91177308-0d34-0410-b5e6-96231b3b80d8
* Get the number of bits to set in a mask correct for a shl/lshr transform.Reid Spencer2007-03-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35357 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1271:Reid Spencer2007-03-26
| | | | | | | | | Fix SingleSource/Regression/C/2003-05-21-UnionBitFields.c by changing a getHighBitsSet call to getLowBitsSet call that was incorrectly converted from the original lshr constant expression. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35348 91177308-0d34-0410-b5e6-96231b3b80d8
* Look through bitcast when finding IVs. (Chris' patch really.)Dale Johannesen2007-03-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35347 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1271:Reid Spencer2007-03-25
| | | | | | | | | | | Remove a use of getLowBitsSet that caused the mask used for replacement of shl/lshr pairs with an AND instruction to be computed incorrectly. Its not clear exactly why this is the case. This solves the disappearing shifts problem, but it doesn't fix Regression/C/2003-05-21-UnionBitFields. It seems there is more going on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35342 91177308-0d34-0410-b5e6-96231b3b80d8
* implement Transforms/InstCombine/cast2.ll:test3 and PR1263Chris Lattner2007-03-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35341 91177308-0d34-0410-b5e6-96231b3b80d8
* Some cleanup from review:Reid Spencer2007-03-25
| | | | | | | | | | * Don't assume shift amounts are <= 64 bits * Avoid creating an extra APInt in SubOne and AddOne by using -- and ++ * Add another use of getLowBitsSet * Convert a series of if statements to a switch git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35339 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor several ConstantExpr::getXXX calls with ConstantInt argumentsReid Spencer2007-03-25
| | | | | | | | | using the facilities of APInt. While this duplicates a tiny fraction of the constant folding code, it also makes the code easier to read and avoids large ConstantExpr overhead for simple, known computations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35335 91177308-0d34-0410-b5e6-96231b3b80d8