summaryrefslogtreecommitdiff
path: root/lib/Analysis/ScalarEvolution.cpp
Commit message (Collapse)AuthorAge
* Revert last patch. It was already fixed.Reid Spencer2007-04-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36102 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1336:Reid Spencer2007-04-16
| | | | | | | | Fix a div-by-zero bug noticed by APInt. This fixes: test/Transforms/IndVarsSimplify/exit_value_tests.llx git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36099 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a nasty bug introduced when apint'ified. This fixesChris Lattner2007-04-15
| | | | | | | Transforms/IndVarsSimplify/exit_value_tests.llx git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36081 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate unnecessary APInt construction.Zhou Sheng2007-04-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35740 91177308-0d34-0410-b5e6-96231b3b80d8
* Make APInt variables do the computation stuffs instead ofZhou Sheng2007-04-07
| | | | | | | ConstantExpr::getXX if possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35738 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate unnecessary zext/trunc stuffs.Zhou Sheng2007-04-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35737 91177308-0d34-0410-b5e6-96231b3b80d8
* Treat xor of signbit like an add.Chris Lattner2007-04-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35586 91177308-0d34-0410-b5e6-96231b3b80d8
* Guard further against APInt operations with operands of unequal bit width.Reid Spencer2007-03-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34897 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an unequal bitwidth issue.Reid Spencer2007-03-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34831 91177308-0d34-0410-b5e6-96231b3b80d8
* Prefer non-virtual calls to ConstantInt::isZero over virtual calls toReid Spencer2007-03-02
| | | | | | | Constant::isNullValue() in situations where it is possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34821 91177308-0d34-0410-b5e6-96231b3b80d8
* Make it possible to create an SCEVUnknown from an APInt as well as an int.Reid Spencer2007-03-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34816 91177308-0d34-0410-b5e6-96231b3b80d8
* Construct ConstantInt with simpler constructor.Reid Spencer2007-03-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34795 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix last night's 445.gobmk breakage which was caused by comparison ofReid Spencer2007-03-01
| | | | | | | APInt's of unequal bitwidth. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34790 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the "isSigned" parameters from ConstantRange. It turns out theyReid Spencer2007-03-01
| | | | | | | | | are not needed as the results are the same with or without it. Patch by Nicholas Lewycky. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34782 91177308-0d34-0410-b5e6-96231b3b80d8
* APIntify various computations in ScalarEvolutionReid Spencer2007-03-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34780 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1205:Reid Spencer2007-02-28
| | | | | | | Make GetConstantFactor compute its result using an APInt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34765 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1205:Reid Spencer2007-02-28
| | | | | | | Adjust to changes in ConstantRange interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34762 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1205:Reid Spencer2007-02-28
| | | | | | | | Remove ConstantInt from ConstantRange interface and adjust its users to compensate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34758 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1205:Reid Spencer2007-02-28
| | | | | | | | First round of ConstantRange changes. This makes all CR constructors use only APInt and not use ConstantInt. Clients are adjusted accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34756 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes to support making the shift instructions be true BinaryOperators.Reid Spencer2007-02-02
| | | | | | | | | | | | | This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33776 91177308-0d34-0410-b5e6-96231b3b80d8
* The local "ConstantFold" method is now just a watered down version ofChris Lattner2007-01-30
| | | | | | | | ConstantFoldInstOperands. Switch to ConstantFoldInstOperands and remove ConstantFold. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33683 91177308-0d34-0410-b5e6-96231b3b80d8
* adjust to constant folding api changes.Chris Lattner2007-01-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33673 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1043:Reid Spencer2007-01-19
| | | | | | | | | | | | | | | This is the final patch for this PR. It implements some minor cleanup in the use of IntegerType, to wit: 1. Type::getIntegerTypeMask -> IntegerType::getBitMask 2. Type::Int*Ty changed to IntegerType* from Type* 3. ConstantInt::getType() returns IntegerType* now, not Type* This also fixes PR1120. Patch by Sheng Zhou. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33370 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak VC++ build.Jeff Cohen2007-01-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33242 91177308-0d34-0410-b5e6-96231b3b80d8
* rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.Chris Lattner2007-01-15
| | | | | | | | | | rename Type::getIntegralTypeMask to Type::getIntegerTypeMask. This makes naming much more consistent. For example, there are now no longer any instances of IntegerType that are not considered isInteger! :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33225 91177308-0d34-0410-b5e6-96231b3b80d8
* Update code to eliminate calls to isInteger, calling isIntegral instead.Chris Lattner2007-01-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33220 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR1101 and Analysis/ScalarEvolution/trip-count.llChris Lattner2007-01-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33193 91177308-0d34-0410-b5e6-96231b3b80d8
* don't discriminate against boolChris Lattner2007-01-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33128 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement review feedback for the ConstantBool->ConstantInt merge. ChrisReid Spencer2007-01-12
| | | | | | | | | recommended that getBoolValue be replaced with getZExtValue and that get(bool) be replaced by get(const Type*, uint64_t). This implements those changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33110 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename BoolTy as Int1Ty. Patch by Sheng Zhou.Reid Spencer2007-01-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33076 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1043:Zhou Sheng2007-01-11
| | | | | | | | Merge ConstantIntegral and ConstantBool into ConstantInt. Remove ConstantIntegral and ConstantBool from LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33073 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert uses of getPrimitiveSize that should be getPrimitiveSizeInBits.Reid Spencer2007-01-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33003 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR1015 and Transforms/IndVarsSimplify/2007-01-06-TripCount.ll, aChris Lattner2007-01-07
| | | | | | | miscompilation of Qt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32974 91177308-0d34-0410-b5e6-96231b3b80d8
* cast of int to bool no longer does a compare, rendering this fixmeChris Lattner2007-01-07
| | | | | | | obsolete git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32972 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR950:Reid Spencer2006-12-31
| | | | | | | | | | | | | | This patch replaces signed integer types with signless ones: 1. [US]Byte -> Int8 2. [U]Short -> Int16 3. [U]Int -> Int32 4. [U]Long -> Int64. 5. Removal of isSigned, isUnsigned, getSignedVersion, getUnsignedVersion and other methods related to signedness. In a few places this warranted identifying the signedness information from other sources. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32785 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR950:Reid Spencer2006-12-23
| | | | | | | | | This patch removes the SetCC instructions and replaces them with the ICmp and FCmp instructions. The SetCondInst instruction has been removed and been replaced with ICmpInst and FCmpInst. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32751 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a FIXME about signedness.Reid Spencer2006-12-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32732 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some comments about things that can go away once signless types are in.Reid Spencer2006-12-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32727 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate static ctors from StatisticsChris Lattner2006-12-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32697 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in GetConstantFactor for affine expressions, in which the existingChris Lattner2006-12-19
| | | | | | | code was wrong for things like 3+4*i. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32662 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace inferred getCast(V,Ty) calls with more strict variants.Reid Spencer2006-12-12
| | | | | | | | Rename getZeroExtend and getSignExtend to getZExt and getSExt to match the the casting mnemonics in the rest of LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32514 91177308-0d34-0410-b5e6-96231b3b80d8
* Get even more accurate on the casting.Reid Spencer2006-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32478 91177308-0d34-0410-b5e6-96231b3b80d8
* Change inferred getCast into specific getCast. Passes all tests.Reid Spencer2006-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32469 91177308-0d34-0410-b5e6-96231b3b80d8
* teach scev to analyze X*4|1 like X*4+c. This allows us to produce:Chris Lattner2006-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LBB1_1: #bb movdqa (%esi), %xmm2 movaps %xmm2, %xmm3 punpcklbw %xmm0, %xmm3 movaps %xmm3, %xmm4 punpcklwd %xmm0, %xmm4 cvtdq2ps %xmm4, %xmm4 mulps %xmm1, %xmm4 movaps %xmm4, (%edi) leal 1(,%eax,4), %ebx shll $4, %ebx punpckhwd %xmm0, %xmm3 cvtdq2ps %xmm3, %xmm3 mulps %xmm1, %xmm3 movaps %xmm3, (%edx,%ebx) leal 2(,%eax,4), %ebx shll $4, %ebx punpckhbw %xmm0, %xmm2 movaps %xmm2, %xmm3 punpcklwd %xmm0, %xmm3 cvtdq2ps %xmm3, %xmm3 mulps %xmm1, %xmm3 movaps %xmm3, (%edx,%ebx) leal 3(,%eax,4), %ebx shll $4, %ebx punpckhwd %xmm0, %xmm2 cvtdq2ps %xmm2, %xmm2 mulps %xmm1, %xmm2 movaps %xmm2, (%edx,%ebx) addl $64, %edi incl %eax addl $16, %esi cmpl %ecx, %eax jne LBB1_1 #bb instead of: LBB1_1: #bb movdqa (%esi), %xmm2 movaps %xmm2, %xmm3 punpcklbw %xmm0, %xmm3 movaps %xmm3, %xmm4 punpcklwd %xmm0, %xmm4 cvtdq2ps %xmm4, %xmm4 mulps %xmm1, %xmm4 movaps %xmm4, (%edi) leal 1(,%eax,4), %ebx shll $4, %ebx punpckhwd %xmm0, %xmm3 cvtdq2ps %xmm3, %xmm3 mulps %xmm1, %xmm3 movaps %xmm3, (%edx,%ebx) leal 2(,%eax,4), %ebx shll $4, %ebx punpckhbw %xmm0, %xmm2 movaps %xmm2, %xmm3 punpcklwd %xmm0, %xmm3 cvtdq2ps %xmm3, %xmm3 mulps %xmm1, %xmm3 movaps %xmm3, (%edx,%ebx) leal 3(,%eax,4), %ebx shll $4, %ebx punpckhwd %xmm0, %xmm2 cvtdq2ps %xmm2, %xmm2 mulps %xmm1, %xmm2 movaps %xmm2, (%edx,%ebx) addl $64, %edi incl %eax addl $16, %esi cmpl %ecx, %eax jne LBB1_1 #bb for a testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32463 91177308-0d34-0410-b5e6-96231b3b80d8
* clarify some comments, simplify some checks, fix:Chris Lattner2006-12-11
| | | | | | | Regression/Transforms/IndVarsSimplify/2006-12-10-BitCast.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32420 91177308-0d34-0410-b5e6-96231b3b80d8
* Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, areBill Wendling2006-12-07
| | | | | | | now cerr, cout, and NullStream resp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32298 91177308-0d34-0410-b5e6-96231b3b80d8
* Detemplatize the Statistic class. The only type it is instantiated withChris Lattner2006-12-06
| | | | | | | is 'unsigned'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32279 91177308-0d34-0410-b5e6-96231b3b80d8
* Finally get the casting right in this file. Also, remove some unnecessaryReid Spencer2006-12-05
| | | | | | | casting because sdiv doesn't require operand signs to match any more. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32240 91177308-0d34-0410-b5e6-96231b3b80d8
* Bail on the getInferredCast idea. Remove the function and convertReid Spencer2006-12-05
| | | | | | | remaining uses to more specific casts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32231 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comment grammaroReid Spencer2006-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32198 91177308-0d34-0410-b5e6-96231b3b80d8