aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Supress a gcc-4.3 warning.Duncan Sands2008-07-181-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53771 91177308-0d34-0410-b5e6-96231b3b80d8
* Make PRE actually handle critical edges (by splitting them). Confirmed that ↵Owen Anderson2008-07-181-3/+6
| | | | | | bootstrap passes with this change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53762 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r53735. My last patch fixed the failures Dan observed.Owen Anderson2008-07-181-52/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53761 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some checks that got lost in the shuffle. This fixes 464.h264ref.Owen Anderson2008-07-181-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53760 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r53735. It broke SPEC 464.h264ref.Dan Gohman2008-07-181-9/+52
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53757 91177308-0d34-0410-b5e6-96231b3b80d8
* Use MergeBlockIntoPredecessor to simplify some code.Owen Anderson2008-07-171-52/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53735 91177308-0d34-0410-b5e6-96231b3b80d8
* Make MergeBlockIntoPredecessor more aggressive when the same successor appearsOwen Anderson2008-07-171-5/+24
| | | | | | | more than once. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53731 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable PRE. My last batch of changes fixed the miscompile.Owen Anderson2008-07-171-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53730 91177308-0d34-0410-b5e6-96231b3b80d8
* Make GlobalOpt preserve address spaces when scalar replacing aggregate globals.Matthijs Kooijman2008-07-171-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53716 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2553Chris Lattner2008-07-171-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53715 91177308-0d34-0410-b5e6-96231b3b80d8
* Inliner tweak. Function calls should cost more than one instruction!Evan Cheng2008-07-171-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53712 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor MergeBlockIntoPredecessor out into BasicBlockUtils.Owen Anderson2008-07-172-51/+56
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53705 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53691 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53673 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2296. Do not transform x86_sse2_storel_dq into a full-width store.Evan Cheng2008-07-161-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53666 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert this, as it seems to still be broken.Owen Anderson2008-07-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53627 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable local PRE by default.Owen Anderson2008-07-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53616 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53615 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53610 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53609 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53608 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use isa when we can reuse a previous dyn_cast.Matthijs Kooijman2008-07-151-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53607 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53606 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53601 91177308-0d34-0410-b5e6-96231b3b80d8
* Split DAE::MarkLive into MarkLive and PropagateLiveness.Matthijs Kooijman2008-07-151-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53600 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass around const RetOrArg references instead of copying values. Also, markMatthijs Kooijman2008-07-151-3/+3
| | | | | | | RetOrArg::getDescription() as const. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53599 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify debug code by using RetOrArg::getDescription().Matthijs Kooijman2008-07-151-6/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53598 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix indentation (intentionally left out of the previous commit).Matthijs Kooijman2008-07-151-51/+51
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53592 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the deadargelim code for intrinsically alive functions into its ownMatthijs Kooijman2008-07-151-23/+25
| | | | | | | method, to slightly simplify control flow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53591 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix uninitialized use of the Changed variable.Dan Gohman2008-07-141-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53564 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r53540, now with the matching header!Chris Lattner2008-07-141-1/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53557 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r53540 - it does not compile.Duncan Sands2008-07-141-23/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53549 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53540 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify some code, shuffle and insertelt always return a vector.Chris Lattner2008-07-141-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53538 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 } git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53534 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix mishandling of the infinite loop case when merging two blocks. ThisChris Lattner2008-07-131-17/+26
| | | | | | | fixes PR2540. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53533 91177308-0d34-0410-b5e6-96231b3b80d8
* more refactoring. Use early exits instead of really complex logic.Chris Lattner2008-07-131-109/+98
| | | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53532 91177308-0d34-0410-b5e6-96231b3b80d8
* improve comments.Chris Lattner2008-07-131-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53531 91177308-0d34-0410-b5e6-96231b3b80d8
* factor another large hunk of code out into its own function. Chris Lattner2008-07-131-155/+172
| | | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53530 91177308-0d34-0410-b5e6-96231b3b80d8
* Final bit of simplification for FoldBranchToCommonDest.Chris Lattner2008-07-131-32/+34
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53528 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify logic a bitChris Lattner2008-07-131-9/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53527 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor some code out into its own helper function, getting rid of crazy ↵Chris Lattner2008-07-131-54/+84
| | | | | | | | | | | multiline conditionals and commenting the code better. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53526 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance analysis of srem.Nick Lewycky2008-07-121-15/+3
| | | | | | | | Remove dead code analyzing urem. 'urem' of power-of-2 is canonicalized to an 'and' instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53506 91177308-0d34-0410-b5e6-96231b3b80d8
* Use find instead of lower_bound.Dan Gohman2008-07-111-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53474 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't call lookupNumber more than we have to.Owen Anderson2008-07-111-5/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53470 91177308-0d34-0410-b5e6-96231b3b80d8
* Document 'mask' in this calculation.Nick Lewycky2008-07-111-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53454 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove misleading constant from comment.Nick Lewycky2008-07-111-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53452 91177308-0d34-0410-b5e6-96231b3b80d8
* Add another optimization from PR2330. Also catch some missing cases that areNick Lewycky2008-07-111-0/+39
| | | | | | | similar. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53451 91177308-0d34-0410-b5e6-96231b3b80d8
* a missed optimization that Eli spottedChris Lattner2008-07-111-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53449 91177308-0d34-0410-b5e6-96231b3b80d8
* another bug in the same line.Chris Lattner2008-07-111-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53448 91177308-0d34-0410-b5e6-96231b3b80d8