summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/sub.ll
Commit message (Collapse)AuthorAgeFilesLines
...
* InstCombine: Annotate sub with nsw when we prove it's safeDavid Majnemer2014-08-191-0/+36
| | | | | | | | | | We can prove that a 'sub' can be a 'sub nsw' under certain conditions: - The sign bits of the operands is the same. - Both operands have more than 1 sign bit. The subtraction cannot be a signed overflow in either case. llvm-svn: 216037
* InstCombine: Correctly propagate NSW/NUW for x-(-A) -> x+ADavid Majnemer2014-07-311-0/+9
| | | | | | | | | | | | We can only propagate the nsw bits if both subtraction instructions are marked with the appropriate bit. N.B. We only propagate the nsw bit in InstCombine because the nuw case is already handled in InstSimplify. This fixes PR20189. llvm-svn: 214385
* InstCombine: Optimize x/INT_MIN to x==INT_MINDavid Majnemer2014-07-021-6/+6
| | | | | | | The result of x/INT_MIN is either 0 or 1, we can just use an icmp instead. llvm-svn: 212167
* InstCombine: Add a vector variant test for PR20186David Majnemer2014-07-021-6/+7
| | | | | | | No functional change, just adding more test coverage that was meant to go in with r212164. llvm-svn: 212165
* InstCombine: Don't turn -(x/INT_MIN) -> x/INT_MINDavid Majnemer2014-07-021-0/+19
| | | | | | | | | It is not safe to negate the smallest signed integer, doing so yields the same number back. This fixes PR20186. llvm-svn: 212164
* InstCombine: Teach most integer add/sub/mul/div combines how to deal with ↵Benjamin Kramer2014-01-191-1/+53
| | | | | | vectors. llvm-svn: 199602
* Teach InstCombine about address spacesMatt Arsenault2013-08-211-53/+118
| | | | llvm-svn: 188926
* Update Transforms tests to use CHECK-LABEL for easier debugging. No ↵Stephen Lin2013-07-141-33/+33
| | | | | | | | | | | | | | | | | | | | | | functionality change. This update was done with the following bash script: find test/Transforms -name "*.ll" | \ while read NAME; do echo "$NAME" if ! grep -q "^; *RUN: *llc" $NAME; then TEMP=`mktemp -t temp` cp $NAME $TEMP sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \ while read FUNC; do sed -i '' "s/;\(.*\)\([A-Za-z0-9_]*\):\( *\)@$FUNC\([( ]*\)\$/;\1\2-LABEL:\3@$FUNC(/g" $TEMP done mv $TEMP $NAME fi done llvm-svn: 186268
* InstCombine: Make OptimizePointerDifference more aggressive.Benjamin Kramer2012-02-201-0/+26
| | | | | | | | | - Ignore pointer casts. - Also expand GEPs that aren't constantexprs when they have one use or only constant indices. - We now compile "&foo[i] - &foo[j]" into "i - j". llvm-svn: 150961
* manually upgrade a bunch of tests to modern syntax, and remove some thatChris Lattner2011-06-171-1/+1
| | | | | | are either unreduced or only test old syntax. llvm-svn: 133228
* Add some transforms of the kind X-Y>X -> 0>Y which are valid when there is noDuncan Sands2011-02-181-1/+1
| | | | | | overflow. These subsume some existing equality transforms, so zap those. llvm-svn: 125843
* implement the first part of PR8882: when lowering an inboundsChris Lattner2011-02-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | gep to explicit addressing, we know that none of the intermediate computation overflows. This could use review: it seems that the shifts certainly wouldn't overflow, but could the intermediate adds overflow if there is a negative index? Previously the testcase would instcombine to: define i1 @test(i64 %i) { %p1.idx.mask = and i64 %i, 4611686018427387903 %cmp = icmp eq i64 %p1.idx.mask, 1000 ret i1 %cmp } now we get: define i1 @test(i64 %i) { %cmp = icmp eq i64 %i, 1000 ret i1 %cmp } llvm-svn: 125271
* more cleanups, notably bitcast isn't used for "signed to unsigned type Chris Lattner2011-02-101-1/+1
| | | | | | conversions". :) llvm-svn: 125265
* InstCombine: Implement X - A*-B -> X + A*B.Benjamin Kramer2010-11-221-0/+20
| | | | llvm-svn: 119984
* Add a small transform: transform -(X<<Y) to (-X<<Y) when the shift has a singleEli Friedman2010-01-311-0/+8
| | | | | | use and X is free to negate. llvm-svn: 94941
* just remove this xform which is subsumed by others.Chris Lattner2010-01-051-2/+2
| | | | llvm-svn: 92775
* generalize the pointer difference optimization to handleChris Lattner2010-01-011-0/+13
| | | | | | | | a constantexpr gep on the 'base' side of the expression. This completes comment #4 in PR3351, which comes from 483.xalancbmk. llvm-svn: 92402
* teach instcombine to optimize pointer difference idioms involving constantChris Lattner2010-01-011-0/+12
| | | | | | expressions. This is a step towards comment #4 in PR3351. llvm-svn: 92401
* move two functions up higher in the file. Delete a useless argumentChris Lattner2009-11-041-1/+38
| | | | | | | | | | | | | | to EmitGEPOffset. Implement some new transforms for optimizing subtracts of two pointer to ints into the same vector. This happens for C++ iterator idioms for example, stringmap takes a const char* that points to the start and end of a string. Once inlined, we want the pointer difference to turn back into a length. This is rdar://7362831. llvm-svn: 86021
* filecheckize this test.Chris Lattner2009-11-041-56/+121
| | | | llvm-svn: 86020
* Use opt -S instead of piping bitcode output through llvm-dis.Dan Gohman2009-09-081-1/+1
| | | | llvm-svn: 81257
* Change these tests to feed the assembly files to opt directly, insteadDan Gohman2009-09-081-1/+1
| | | | | | of using llvm-as, now that opt supports this. llvm-svn: 81226
* Instcombine was illegally transforming -X/C into X/-C when either X or CBill Wendling2008-11-301-3/+5
| | | | | | | | overflowed on negation. This commit checks to make sure that neithe C nor X overflows. This requires that the RHS of X (a subtract instruction) be a constant integer. llvm-svn: 60275
* Implement PR2298. This transforms:Chris Lattner2008-05-091-0/+10
| | | | | | | ~x < ~y --> y < x -x == -y --> x == y llvm-svn: 50882
* Remove llvm-upgrade and update test cases.Tanya Lattner2008-03-011-92/+89
| | | | llvm-svn: 47793
* For PR1319:Reid Spencer2007-04-141-2/+1
| | | | | | Upgrade tests to work with new llvm.exp version of llvm_runtest. llvm-svn: 36013
* For PR761:Reid Spencer2007-01-261-1/+1
| | | | | | | | | | | | | | Remove "target endian/pointersize" or add "target datalayout" to make the test parse properly or set the datalayout because defaults changes. For PR645: Make global names use the @ prefix. For llvm-upgrade changes: Fix test cases or completely remove use of llvm-upgrade for test cases that cannot survive the new renaming or upgrade capabilities. llvm-svn: 33533
* Regression is gone, don't try to find it on clean target.Reid Spencer2007-01-171-0/+140
llvm-svn: 33296
OpenPOWER on IntegriCloud