summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* 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. llvm-svn: 50096
* add a basic testcase.Chris Lattner2008-04-222-0/+34
| | | | llvm-svn: 50093
* 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. llvm-svn: 50079
* 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. llvm-svn: 50034
* rename *.llx -> *.ll, last batch.Chris Lattner2008-04-1942-0/+0
| | | | llvm-svn: 49971
* 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. llvm-svn: 49769
* Add testcase for PR2213.Owen Anderson2008-04-111-0/+12
| | | | llvm-svn: 49517
* 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. llvm-svn: 49492
* 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). llvm-svn: 49437
* remove capital letter from test name.Chris Lattner2008-04-091-0/+0
| | | | llvm-svn: 49436
* 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. llvm-svn: 49419
* 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. llvm-svn: 49411
* merge r48768 from branches/ggreif/parallelized-testGabor Greif2008-04-081-3/+0
| | | | llvm-svn: 49382
* add a testcase for forming memset from noncontiguous stores.Chris Lattner2008-03-292-1/+100
| | | | llvm-svn: 48938
* 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. llvm-svn: 48791
* Byebye llvm-upgrade!Tanya Lattner2008-03-2527-882/+654
| | | | llvm-svn: 48762
* Add incoming value from header only if phi node has any use inside the loop.Devang Patel2008-03-241-0/+69
| | | | llvm-svn: 48738
* apparently tclsh doesn't lex like bash. Weird.Chris Lattner2008-03-241-1/+1
| | | | llvm-svn: 48732
* pass the option so this test tests the right thing.Chris Lattner2008-03-241-2/+2
| | | | llvm-svn: 48731
* 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. llvm-svn: 48715
* Use normal naming convention for test.Owen Anderson2008-03-221-0/+0
| | | | llvm-svn: 48693
* 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 :) llvm-svn: 48680
* 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. llvm-svn: 48631
* Upgrade tests.Tanya Lattner2008-03-1948-2357/+2209
| | | | llvm-svn: 48538
* Upgrade tests.Tanya Lattner2008-03-1926-723/+610
| | | | llvm-svn: 48536
* Upgrade tests to not use llvm-upgrade.Tanya Lattner2008-03-1923-273/+288
| | | | llvm-svn: 48530
* Upgrade tests to not use llvm-upgrade.Tanya Lattner2008-03-1923-480/+421
| | | | llvm-svn: 48529
* Remove llvm-upgrade and update tests.Tanya Lattner2008-03-1925-434/+333
| | | | llvm-svn: 48527
* Upgrade tests to not use llvm-upgrade.Tanya Lattner2008-03-1823-377/+336
| | | | llvm-svn: 48484
* Upgrade tests to not use llvm-upgrade.Tanya Lattner2008-03-1826-605/+564
| | | | llvm-svn: 48483
* 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 llvm-svn: 48354
* 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. llvm-svn: 48343
* 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. llvm-svn: 48280
* Fix attribute handling.Devang Patel2008-03-121-0/+7
| | | | llvm-svn: 48262
* Handle multiple ret values.Devang Patel2008-03-111-0/+20
| | | | llvm-svn: 48254
* 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. llvm-svn: 48252
* Make this test more challenging to help it avoid beingDan Gohman2008-03-111-2/+8
| | | | | | optimized away before it tests what it is intended to test. llvm-svn: 48251
* Initial multiple return values support.Devang Patel2008-03-111-0/+12
| | | | llvm-svn: 48210
* Upgrade this test.Dan Gohman2008-03-111-6/+6
| | | | llvm-svn: 48207
* SimplifyDevang Patel2008-03-102-33/+51
| | | | llvm-svn: 48163
* Remove llvm-upgrade and update tests.Tanya Lattner2008-03-1060-2070/+1594
| | | | llvm-svn: 48137
* Turn unwind_to into "unwinds to".Nick Lewycky2008-03-103-15/+15
| | | | llvm-svn: 48123
* Remove llvm-upgrade and update tests.Tanya Lattner2008-03-0949-726/+800
| | | | llvm-svn: 48103
* Firstly, having a BranchInst isn't exclusive with having an unwind_to.Nick Lewycky2008-03-091-0/+18
| | | | | | | Secondly, we have to check whether the branch is actually pointing to the block with the unwind in it. We could have gotten here because of the unwind_to alone. llvm-svn: 48099
* A BB that unwind_to an "unwind" inst is that same as one that doesn't unwind_toNick Lewycky2008-03-091-0/+8
| | | | | | at all. llvm-svn: 48096
* Update the inliner and simplifycfg to handle unwind_to.Nick Lewycky2008-03-092-0/+48
| | | | llvm-svn: 48086
* Prune the unwind_to labels on BBs that don't need them. Another step in theNick Lewycky2008-03-091-0/+15
| | | | | | removal of invoke, PR1269. llvm-svn: 48084
* Update inliner to handle functions that return multiple values.Devang Patel2008-03-072-0/+92
| | | | llvm-svn: 48020
* Place for sret promotion tests.Devang Patel2008-03-071-0/+3
| | | | llvm-svn: 48016
* Commit the testcase too.Nick Lewycky2008-03-061-0/+8
| | | | llvm-svn: 47988
OpenPOWER on IntegriCloud