summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Reinstate this optimization, but without the miscompile. Thanks to Bill forNick Lewycky2008-08-061-0/+15
| | | | | | tracking down that this was breaking llvm-gcc bootstrap on Linux. llvm-svn: 54394
* Pass the computed iteration count value to RewriteLoopExitValuesDan Gohman2008-08-051-4/+4
| | | | | | instead of having it call getIterationCount again. llvm-svn: 54380
* Revert r53282. This was causing a miscompile on Linux. Also, the transformationBill Wendling2008-08-051-16/+0
| | | | | | looks bogus. Please see PR2629 for details on why this is breaking things. llvm-svn: 54372
* Trim #includes.Dan Gohman2008-08-051-1/+0
| | | | llvm-svn: 54350
* Fix comment typos.Duncan Sands2008-08-011-1/+1
| | | | llvm-svn: 54266
* Add vector shifts to the IR, patch by Eli Friedman.Nate Begeman2008-07-291-1/+2
| | | | | | CodeGen & Clang work coming next. llvm-svn: 54161
* Add -unroll-allow-partial command line option that enabled the loop unroller toMatthijs Kooijman2008-07-291-4/+26
| | | | | | | | partially unroll a loop when fully unrolling would not fit under the threshold. Patch by Mikael Lepistö. llvm-svn: 54160
* Restructure ArgumentPromotion a bit. Instead of just having a single booleanMatthijs Kooijman2008-07-291-99/+235
| | | | | | | | | | | | | that says "unconditional loads from this argument are safe", we now keep track of the safety per set of indices from which loads happen. This prevents ArgPromotion from promoting loads that aren't really valid. As an added effect, this will now disregard the the type of the indices passed to a GEP, so "load GEP %A, i32 1" and "load GEP %A, i64 1" will result in a single argument, not two. This fixes PR2598, for which a testcase has been added as well. llvm-svn: 54159
* Don't remove volatile loads. Thanks to Duncan for noticing this one.Owen Anderson2008-07-281-1/+1
| | | | llvm-svn: 54144
* Add support for eliminating stores that store the same value that was just ↵Owen Anderson2008-07-281-2/+35
| | | | | | | | loaded. This fixes PR2599. llvm-svn: 54133
* Rename SDOperand to SDValue.Dan Gohman2008-07-271-1/+1
| | | | llvm-svn: 54128
* Put the LICM of constant GlobalVariables, introduced in r53945, under aDan Gohman2008-07-241-1/+11
| | | | | | | command-line option, and disable it by default. It introduced performance regressions because CodeGen is currently not able to remat such loads. llvm-svn: 53997
* "Allow LICM to sink or lift loads from constant memory. Also add a testChris Lattner2008-07-231-0/+5
| | | | | | | | | | | case for this. This allows instructions like loads from global variables declared to be constant to be moved out of loops." Patch by Stefanus Du Toit! llvm-svn: 53945
* Enable first-class aggregates support.Dan Gohman2008-07-2310-261/+68
| | | | | | | | | | | | Remove the GetResultInst instruction. It is still accepted in LLVM assembly and bitcode, where it is now auto-upgraded to ExtractValueInst. Also, remove support for return instructions with multiple values. These are auto-upgraded to use InsertValueInst instructions. The IRBuilder still accepts multiple-value returns, and auto-upgrades them to InsertValueInst instructions. llvm-svn: 53941
* Fix a bug in LSR's dead-PHI cleanup. If a PHI has a def-use chain thatDan Gohman2008-07-211-0/+5
| | | | | | | | | leads into a cycle involving a different PHI, LSR got stuck running around that cycle looking for the original PHI. To avoid this, keep track of visited PHIs and stop searching if we see one more than once. This fixes PR2570. llvm-svn: 53879
* Supress a gcc-4.3 warning.Duncan Sands2008-07-181-1/+1
| | | | llvm-svn: 53771
* Make PRE actually handle critical edges (by splitting them). Confirmed that ↵Owen Anderson2008-07-181-3/+6
| | | | | | bootstrap passes with this change. llvm-svn: 53762
* Reapply r53735. My last patch fixed the failures Dan observed.Owen Anderson2008-07-181-52/+9
| | | | llvm-svn: 53761
* Add some checks that got lost in the shuffle. This fixes 464.h264ref.Owen Anderson2008-07-181-0/+4
| | | | llvm-svn: 53760
* Revert r53735. It broke SPEC 464.h264ref.Dan Gohman2008-07-181-9/+52
| | | | llvm-svn: 53757
* Use MergeBlockIntoPredecessor to simplify some code.Owen Anderson2008-07-171-52/+9
| | | | llvm-svn: 53735
* Make MergeBlockIntoPredecessor more aggressive when the same successor appearsOwen Anderson2008-07-171-5/+24
| | | | | | more than once. llvm-svn: 53731
* Enable PRE. My last batch of changes fixed the miscompile.Owen Anderson2008-07-171-1/+1
| | | | llvm-svn: 53730
* Make GlobalOpt preserve address spaces when scalar replacing aggregate globals.Matthijs Kooijman2008-07-171-2/+4
| | | | llvm-svn: 53716
* Fix PR2553Chris Lattner2008-07-171-1/+2
| | | | llvm-svn: 53715
* Inliner tweak. Function calls should cost more than one instruction!Evan Cheng2008-07-171-0/+5
| | | | llvm-svn: 53712
* Factor MergeBlockIntoPredecessor out into BasicBlockUtils.Owen Anderson2008-07-172-51/+56
| | | | llvm-svn: 53705
* There's no need to iterate block merging and PRE. In fact, iterating the latterOwen Anderson2008-07-161-14/+12
| | | | | | could cause problems for memdep when it breaks critical edges. llvm-svn: 53691
* Redo InstCombiner::visitExtractValueInst. Instead of using the (complicate)Matthijs Kooijman2008-07-161-5/+80
| | | | | | | FindInsertedValue, it now performs a number of simple transformations that should result in the same effect when applied iteratively. llvm-svn: 53673
* Fix PR2296. Do not transform x86_sse2_storel_dq into a full-width store.Evan Cheng2008-07-161-1/+0
| | | | llvm-svn: 53666
* Revert this, as it seems to still be broken.Owen Anderson2008-07-151-1/+1
| | | | llvm-svn: 53627
* Enable local PRE by default.Owen Anderson2008-07-151-1/+1
| | | | llvm-svn: 53616
* Have GVN do a pre-pass over the CFG that folds away unconditional branches ↵Owen Anderson2008-07-151-2/+63
| | | | | | where possible. This allows local PRE to be more aggressive. llvm-svn: 53615
* Allow deadargelim to change return types even though now values were dead. ThisMatthijs Kooijman2008-07-151-11/+1
| | | | | | again canonicalizes {i32} into i32 and {} into void. llvm-svn: 53610
* Revert r53606. It turns out that explicitely tracking the liveness of theMatthijs Kooijman2008-07-151-97/+103
| | | | | | | | | | | return value as a whole in deadargelim is really not needed now that we simply rebuild the old return value and actually prevents some canonicalization from taking place. This revert stops deadargelim from changing {i32} into i32 for now, but I'll fix that next. llvm-svn: 53609
* Make deadargelim a bit less smart, so it doesn't choke on nested structs asMatthijs Kooijman2008-07-151-38/+21
| | | | | | | | | | | | return values that are still (partially) live. Instead of updating all uses of a call instruction after removing some elements, it now just rebuilds the original struct (With undef gaps where the unused values were) and leaves it to instcombine to clean this up. The added testcase still fails currently, but this is due to instcombine which isn't good enough yet. I will fix that part next. llvm-svn: 53608
* Don't use isa when we can reuse a previous dyn_cast.Matthijs Kooijman2008-07-151-3/+2
| | | | llvm-svn: 53607
* Make DeadArgElim keep liveness of the return value as a whole in addition toMatthijs Kooijman2008-07-151-126/+124
| | | | | | | | | | | only the liveness of partial return values (for functions returning a struct). This is more explicit to prevent unwanted changes in the return value. In particular, deadargelim now canonicalizes a function returning {i32} to returning i32 and {} to void, if the struct returned is not used in its entirety, but only the single element is used. llvm-svn: 53606
* Let DAE keep a list of live functions, instead of simply marking all argumentsMatthijs Kooijman2008-07-151-6/+14
| | | | | | | and return values live for those functions. This doesn't change anything yet, but prepares for the coming commits. llvm-svn: 53601
* Split DAE::MarkLive into MarkLive and PropagateLiveness.Matthijs Kooijman2008-07-151-0/+6
| | | | llvm-svn: 53600
* Pass around const RetOrArg references instead of copying values. Also, markMatthijs Kooijman2008-07-151-3/+3
| | | | | | RetOrArg::getDescription() as const. llvm-svn: 53599
* Simplify debug code by using RetOrArg::getDescription().Matthijs Kooijman2008-07-151-6/+1
| | | | llvm-svn: 53598
* Fix indentation (intentionally left out of the previous commit).Matthijs Kooijman2008-07-151-51/+51
| | | | llvm-svn: 53592
* Move the deadargelim code for intrinsically alive functions into its ownMatthijs Kooijman2008-07-151-23/+25
| | | | | | method, to slightly simplify control flow. llvm-svn: 53591
* Fix uninitialized use of the Changed variable.Dan Gohman2008-07-141-0/+2
| | | | llvm-svn: 53564
* Reapply r53540, now with the matching header!Chris Lattner2008-07-141-1/+23
| | | | llvm-svn: 53557
* Revert r53540 - it does not compile.Duncan Sands2008-07-141-23/+1
| | | | llvm-svn: 53549
* If a function calls setjmp, never inline it into other functions. This isChris Lattner2008-07-141-1/+23
| | | | | | | a hack around the fact that we don't represent the CFG correctly for sj/lj. It fixes PR2486. llvm-svn: 53540
* simplify some code, shuffle and insertelt always return a vector.Chris Lattner2008-07-141-2/+1
| | | | llvm-svn: 53538
* Fix PR2506 by being a bit more careful about reverse fact propagation whenChris Lattner2008-07-141-64/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | disproving a condition. This actually compiles the existing testcase (udiv_select_to_select_shift) to: define i64 @test(i64 %X, i1 %Cond) { entry: %divisor1.t = lshr i64 %X, 3 ; <i64> [#uses=1] %quotient2 = lshr i64 %X, 3 ; <i64> [#uses=1] %sum = add i64 %divisor1.t, %quotient2 ; <i64> [#uses=1] ret i64 %sum } instead of: define i64 @test(i64 %X, i1 %Cond) { entry: %quotient1.v = select i1 %Cond, i64 3, i64 4 ; <i64> [#uses=1] %quotient1 = lshr i64 %X, %quotient1.v ; <i64> [#uses=1] %quotient2 = lshr i64 %X, 3 ; <i64> [#uses=1] %sum = add i64 %quotient1, %quotient2 ; <i64> [#uses=1] ret i64 %sum } llvm-svn: 53534
OpenPOWER on IntegriCloud