aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* Teach InstCombine's ComputeMaskedBits what SelectionDAG'sDan Gohman2008-04-281-0/+45
| | | | | | | | | | | | ComputeMaskedBits knows about cttz, ctlz, and ctpop. Teach SelectionDAG's ComputeMaskedBits what InstCombine's knows about SRem. And teach them both some things about high bits in Mul, UDiv, URem, and Sub. This allows instcombine and dagcombine to eliminate sign-extension operations in several new cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50358 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2256, yet another miscompilation in simplifycfg of iChris Lattner2008-04-281-0/+30
| | | | | | | | | multiple return values. Bill, please pull this into Tak. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50332 91177308-0d34-0410-b5e6-96231b3b80d8
* When SRoA'ing a global variable, make sure the new globals get the Chris Lattner2008-04-261-0/+32
| | | | | | | | | | appropriate alignment. This fixes a miscompilation of 252.eon on x86-64 (rdar://5891920). Bill, please pull this into Tak. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50308 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989Nick Lewycky2008-04-253-89/+0
| | | | | | | r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50265 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't infininitely thread branches when a threaded edgeChris Lattner2008-04-251-0/+142
| | | | | | | | | | | | | | | goes back to the block, e.g.: Threading edge through bool from 'bb37.us.thread3829' to 'bb37.us' with cost: 1, across block: bb37.us: ; preds = %bb37.us.thread3829, %bb37.us, %bb33 %D1361.1.us = phi i32 [ %tmp36, %bb33 ], [ %D1361.1.us, %bb37.us ], [ 0, %bb37.us.thread3829 ] ; <i32> [#uses=2] %tmp39.us = icmp eq i32 %D1361.1.us, 0 ; <i1> [#uses=1] br i1 %tmp39.us, label %bb37.us, label %bb42.us git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50251 91177308-0d34-0410-b5e6-96231b3b80d8
* Split some code out of the main SimplifyCFG loop into its own function.Chris Lattner2008-04-241-0/+43
| | | | | | | | Fix said code to handle merging return instructions together correctly when handling multiple return values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50199 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite multiple return value handling in SCCP. Before, the -sccp passChris Lattner2008-04-231-0/+11
| | | | | | | | would turn every getresult instruction into undef. This helps with rdar://5778210 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50140 91177308-0d34-0410-b5e6-96231b3b80d8
* remove this testcase. It isn't testing loop rotate, it is testing allChris Lattner2008-04-231-127/+0
| | | | | | | | | of -std-compile-opts and is now failing because other passes are generating IR that looks different to input of loop rotate. Devang, please introduce a testcase that only runs loop rotate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50136 91177308-0d34-0410-b5e6-96231b3b80d8
* make this test more interesting.Chris Lattner2008-04-231-4/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50128 91177308-0d34-0410-b5e6-96231b3b80d8
* distill down the essense of this test.Chris Lattner2008-04-231-7/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50125 91177308-0d34-0410-b5e6-96231b3b80d8
* new testDale Johannesen2008-04-231-0/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50123 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't do: "(X & 4) >> 1 == 2 --> (X & 4) == 4" if there are more than one ↵Evan Cheng2008-04-231-0/+29
| | | | | | uses of the shift result. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50118 91177308-0d34-0410-b5e6-96231b3b80d8
* Start doing the significantly useful part of jump threading: handle casesChris Lattner2008-04-221-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | where a comparison has a phi input and that phi is a constant. For example, stuff like: Threading edge through bool from 'bb2149' to 'bb2231' with cost: 1, across block: bb2237: ; preds = %bb2231, %bb2149 %tmp2328.rle = phi i32 [ %tmp2232, %bb2231 ], [ %tmp2232439, %bb2149 ] ; <i32> [#uses=2] %done.0 = phi i32 [ %done.2, %bb2231 ], [ 0, %bb2149 ] ; <i32> [#uses=1] %tmp2239 = icmp eq i32 %done.0, 0 ; <i1> [#uses=1] br i1 %tmp2239, label %bb2231, label %bb2327 or bb38.i298: ; preds = %bb33.i295, %bb1693 %tmp39.i296.rle = phi %struct.ibox* [ null, %bb1693 ], [ %tmp39.i296.rle1109, %bb33.i295 ] ; <%struct.ibox*> [#uses=2] %minspan.1.i291.reg2mem.1 = phi i32 [ 32000, %bb1693 ], [ %minspan.0.i288, %bb33.i295 ] ; <i32> [#uses=1] %tmp40.i297 = icmp eq %struct.ibox* %tmp39.i296.rle, null ; <i1> [#uses=1] br i1 %tmp40.i297, label %implfeeds.exit311, label %bb43.i301 This triggers thousands of times in spec. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50110 91177308-0d34-0410-b5e6-96231b3b80d8
* Dig through multiple levels of AND to thread jumps if needed.Chris Lattner2008-04-221-0/+33
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50106 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach jump threading to thread through blocks like:Chris Lattner2008-04-221-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | br (and X, phi(Y, Z, false)), label L1, label L2 This triggers once on 252.eon and 6 times on 176.gcc. Blocks in question often look like this: bb262: ; preds = %bb261, %bb248 %iftmp.251.0 = phi i1 [ true, %bb261 ], [ false, %bb248 ] ; <i1> [#uses=4] %tmp270 = icmp eq %struct.rtx_def* %tmp.0.i, null ; <i1> [#uses=1] %bothcond = or i1 %iftmp.251.0, %tmp270 ; <i1> [#uses=1] br i1 %bothcond, label %bb288, label %bb273 In this case, it is clear that it doesn't matter if tmp.0.i is null when coming from bb261. When coming from bb248, it is all that matters. Another random example: check_asm_operands.exit: ; preds = %check_asm_operands.exit.thr_comm, %bb30.i, %bb12.i, %bb6.i413 %tmp.0.i420 = phi i1 [ true, %bb6.i413 ], [ true, %bb12.i ], [ true, %bb30.i ], [ false, %check_asm_operands.exit.thr_comm ; <i1> [#uses=1] call void @llvm.stackrestore( i8* %savedstack ) nounwind %tmp4389 = icmp eq i32 %added_sets_1.0, 0 ; <i1> [#uses=1] %tmp4394 = icmp eq i32 %added_sets_2.0, 0 ; <i1> [#uses=1] %bothcond80 = and i1 %tmp4389, %tmp4394 ; <i1> [#uses=1] %bothcond81 = and i1 %bothcond80, %tmp.0.i420 ; <i1> [#uses=1] br i1 %bothcond81, label %bb4398, label %bb4397 Here is the case from 252.eon: bb290.i.i: ; preds = %bb23.i57.i.i, %bb8.i39.i.i, %bb100.i.i, %bb100.i.i, %bb85.i.i110 %myEOF.1.i.i = phi i1 [ true, %bb100.i.i ], [ true, %bb100.i.i ], [ true, %bb85.i.i110 ], [ true, %bb8.i39.i.i ], [ false, %bb23.i57.i.i ] ; <i1> [#uses=2] %i.4.i.i = phi i32 [ %i.1.i.i, %bb85.i.i110 ], [ %i.0.i.i, %bb100.i.i ], [ %i.0.i.i, %bb100.i.i ], [ %i.3.i.i, %bb8.i39.i.i ], [ %i.3.i.i, %bb23.i57.i.i ] ; <i32> [#uses=3] %tmp292.i.i = load i8* %tmp16.i.i100, align 1 ; <i8> [#uses=1] %tmp293.not.i.i = icmp ne i8 %tmp292.i.i, 0 ; <i1> [#uses=1] %bothcond.i.i = and i1 %tmp293.not.i.i, %myEOF.1.i.i ; <i1> [#uses=1] br i1 %bothcond.i.i, label %bb202.i.i, label %bb301.i.i Factoring out 3 common predecessors. On the path from any blocks other than bb23.i57.i.i, the load and compare are dead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50096 91177308-0d34-0410-b5e6-96231b3b80d8
* add a basic testcase.Chris Lattner2008-04-222-0/+34
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50093 91177308-0d34-0410-b5e6-96231b3b80d8
* optimize "p != gep p, ..." better. This allows us to compile Chris Lattner2008-04-221-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getelementptr-seteq.ll into: define i1 @test(i64 %X, %S* %P) { %C = icmp eq i64 %X, -1 ; <i1> [#uses=1] ret i1 %C } instead of: define i1 @test(i64 %X, %S* %P) { %A.idx.mask = and i64 %X, 4611686018427387903 ; <i64> [#uses=1] %C = icmp eq i64 %A.idx.mask, 4611686018427387903 ; <i1> [#uses=1] ret i1 %C } And fixes the second half of PR2235. This speeds up the insertion sort case by 45%, from 1.12s to 0.77s. In practice, this will significantly speed up for loops structured like: for (double *P = Base + N; P != Base; --P) ... Which happens frequently for C++ iterators. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50079 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor memcpyopt based on Chris' suggestions. Consolidate several functionsOwen Anderson2008-04-212-4/+4
| | | | | | | and simplify code that was fallout from the separation of memcpyopt and gvn. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50034 91177308-0d34-0410-b5e6-96231b3b80d8
* rename *.llx -> *.ll, last batch.Chris Lattner2008-04-1942-0/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49971 91177308-0d34-0410-b5e6-96231b3b80d8
* XFAIL this test for the moment. The real solution is to prevent ADCEOwen Anderson2008-04-161-0/+1
| | | | | | | | from transforming loops and adding a separate loop pass for removing loops with know trip counts. Until that happens, ADCE is miscompiling this code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49769 91177308-0d34-0410-b5e6-96231b3b80d8
* Add testcase for PR2213.Owen Anderson2008-04-111-0/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49517 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach InstCombine's ComputeMaskedBits to handle pointer expressionsDan Gohman2008-04-102-0/+73
| | | | | | | | | | | | | | | | in addition to integer expressions. Rewrite GetOrEnforceKnownAlignment as a ComputeMaskedBits problem, moving all of its special alignment knowledge to ComputeMaskedBits as low-zero-bits knowledge. Also, teach ComputeMaskedBits a few basic things about Mul and PHI instructions. This improves ComputeMaskedBits-based simplifications in a few cases, but more noticeably it significantly improves instcombine's alignment detection for loads, stores, and memory intrinsics. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49492 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize getUnaryFloatFunction to handle any FP unary function, automaticallyChris Lattner2008-04-091-0/+5
| | | | | | | figuring out the suffix to use. implement pow(2,x) -> exp2(x). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49437 91177308-0d34-0410-b5e6-96231b3b80d8
* remove capital letter from test name.Chris Lattner2008-04-091-0/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49436 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor a bunch of functionality related to memcpy and memset transforms out of Owen Anderson2008-04-097-8/+11
| | | | | | | GVN and into its own pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49419 91177308-0d34-0410-b5e6-96231b3b80d8
* many cleanups to the pow optimizer. Allow it to handle powf,Chris Lattner2008-04-091-4/+12
| | | | | | | add support for pow(x, 2.0) -> x*x. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49411 91177308-0d34-0410-b5e6-96231b3b80d8
* merge r48768 from branches/ggreif/parallelized-testGabor Greif2008-04-081-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49382 91177308-0d34-0410-b5e6-96231b3b80d8
* add a testcase for forming memset from noncontiguous stores.Chris Lattner2008-03-292-1/+100
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48938 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle a special case xor undef, undef -> 0. Technically this should be ↵Evan Cheng2008-03-251-0/+6
| | | | | | transformed to undef. But this is such a common idiom (misuse) we are going to handle it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48791 91177308-0d34-0410-b5e6-96231b3b80d8
* Byebye llvm-upgrade!Tanya Lattner2008-03-2527-882/+654
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48762 91177308-0d34-0410-b5e6-96231b3b80d8
* Add incoming value from header only if phi node has any use inside the loop.Devang Patel2008-03-241-0/+69
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48738 91177308-0d34-0410-b5e6-96231b3b80d8
* apparently tclsh doesn't lex like bash. Weird.Chris Lattner2008-03-241-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48732 91177308-0d34-0410-b5e6-96231b3b80d8
* pass the option so this test tests the right thing.Chris Lattner2008-03-241-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48731 91177308-0d34-0410-b5e6-96231b3b80d8
* Transform (zext (or (icmp), (icmp))) to (or (zext (cimp), (zext icmp))) if ↵Evan Cheng2008-03-241-0/+35
| | | | | | at least one of the (zext icmp) can be transformed to eliminate an icmp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48715 91177308-0d34-0410-b5e6-96231b3b80d8
* Use normal naming convention for test.Owen Anderson2008-03-221-0/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48693 91177308-0d34-0410-b5e6-96231b3b80d8
* implement an initial hack at a straight-line store -> memset optimization.Chris Lattner2008-03-221-0/+55
| | | | | | | | | | This fires dozens of times across spec and multisource, but I don't know if it actually speeds stuff up. Hopefully the testers will show something nice :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48680 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach masked value is zero about add and sub, and use MVIZ toChris Lattner2008-03-211-0/+7
| | | | | | | | | | simplify things like (X & 4) >> 1 == 2 --> (X & 4) == 4. since it is obvious that the shift doesn't remove any bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48631 91177308-0d34-0410-b5e6-96231b3b80d8
* Upgrade tests.Tanya Lattner2008-03-1948-2357/+2209
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48538 91177308-0d34-0410-b5e6-96231b3b80d8
* Upgrade tests.Tanya Lattner2008-03-1926-723/+610
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48536 91177308-0d34-0410-b5e6-96231b3b80d8
* Upgrade tests to not use llvm-upgrade.Tanya Lattner2008-03-1923-273/+288
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48530 91177308-0d34-0410-b5e6-96231b3b80d8
* Upgrade tests to not use llvm-upgrade.Tanya Lattner2008-03-1923-480/+421
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48529 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove llvm-upgrade and update tests.Tanya Lattner2008-03-1925-434/+333
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48527 91177308-0d34-0410-b5e6-96231b3b80d8
* Upgrade tests to not use llvm-upgrade.Tanya Lattner2008-03-1823-377/+336
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48484 91177308-0d34-0410-b5e6-96231b3b80d8
* Upgrade tests to not use llvm-upgrade.Tanya Lattner2008-03-1826-605/+564
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48483 91177308-0d34-0410-b5e6-96231b3b80d8
* The inst combining of inttoptr into GEP with one index was using the bit size ofBill Wendling2008-03-141-0/+9
| | | | | | | | | the type instead of the byte size. This was causing troublesome mis-compilations. True to form, this took 2 days to find and is a one-line fix. :-P git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48354 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in GVN that Duncan noticed, where we potentially need to insert a Owen Anderson2008-03-131-0/+19
| | | | | | | pointer bitcast when performing return slot optimization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48343 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve the return slot optimization to be both more aggressive (not limited ↵Owen Anderson2008-03-121-2/+4
| | | | | | | | | | to sret parameters), and safer (when the passed pointer might be invalid). Thanks to Duncan and Chris for the idea behind this, and extra thanks to Duncan for helping me work out the trap-safety. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48280 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix attribute handling.Devang Patel2008-03-121-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48262 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle multiple ret values.Devang Patel2008-03-111-0/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48254 91177308-0d34-0410-b5e6-96231b3b80d8
* Check to see if a two-entry PHI block can be simplifiedDan Gohman2008-03-111-0/+15
| | | | | | | | | before trying to merge the block into its predecessors. This allows two-entry-phi-return.ll to be simplified into a single basic block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48252 91177308-0d34-0410-b5e6-96231b3b80d8