aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Remove GCSE and LoadVN from the testsuite.Owen Anderson2008-08-1612-121/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54832 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply 54786. Add overflow and number of mantissa bits checks.Devang Patel2008-08-151-0/+99
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54821 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 54786. It's not checking for overflows, etc.Evan Cheng2008-08-151-27/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54813 91177308-0d34-0410-b5e6-96231b3b80d8
* If IV is used in a int-to-float cast inside the loop then try to eliminate ↵Devang Patel2008-08-141-0/+27
| | | | | | the cast opeation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54786 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bogus srem rule - a negative value srem'd by a power-of-2Dan Gohman2008-08-131-0/+18
| | | | | | | | can have a non-negative result; for example, -16%16 is 0. Also, clarify the related comments. This fixes PR2670. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54767 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix SCCP's handling of struct value loads and stores. SCCP doesn'tDan Gohman2008-08-131-0/+20
| | | | | | | | track individual leaf values in such cases, so it needs to treat struct values as normal values in this case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54760 91177308-0d34-0410-b5e6-96231b3b80d8
* Check sign to detect overflow before changing compare stride.Devang Patel2008-08-131-0/+31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54710 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement support for simplifying vector comparisons by 0.0 and 1.0 like weChris Lattner2008-08-111-2/+15
| | | | | | | | | | do for scalars. Patch contributed by Nicolas Capens This also generalizes the previous xforms to work on long double, now that isExactlyValue works for long double. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54653 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a basic test for the SRETPromotion pass.Matthijs Kooijman2008-08-071-0/+33
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54466 91177308-0d34-0410-b5e6-96231b3b80d8
* Move two tests from SRETPromotion to Inline, since they only call opt -inline.Matthijs Kooijman2008-08-072-0/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54465 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a shufflevector instcombine that was emitting invalid masks indicesDan Gohman2008-08-061-0/+109
| | | | | | | when it meant to be emitting undef indices. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54417 91177308-0d34-0410-b5e6-96231b3b80d8
* PR2535, not PR2355.Evan Cheng2008-08-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54416 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2355: bug in ChangeCompareStride. When the loop termination compare is ↵Evan Cheng2008-08-061-0/+24
| | | | | | the only use of its iv stride, the stride can be eliminated by moving it to another stride. If the scale is negative, swap the predicate instead of using a inverse predicate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54415 91177308-0d34-0410-b5e6-96231b3b80d8
* optimize a common idiom generated by clang for bitfield access, PR2638.Chris Lattner2008-08-061-0/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54408 91177308-0d34-0410-b5e6-96231b3b80d8
* Zap sitofp/fptoui pairs. In all cases when the sign difference Chris Lattner2008-08-061-1/+13
| | | | | | | | matters, the result is undefined anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54396 91177308-0d34-0410-b5e6-96231b3b80d8
* Reinstate this optimization, but without the miscompile. Thanks to Bill forNick Lewycky2008-08-061-0/+10
| | | | | | | tracking down that this was breaking llvm-gcc bootstrap on Linux. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54394 91177308-0d34-0410-b5e6-96231b3b80d8
* Just grep for through the LL code instead of the ASM codeBill Wendling2008-08-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54389 91177308-0d34-0410-b5e6-96231b3b80d8
* Add default architecture.Bill Wendling2008-08-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54384 91177308-0d34-0410-b5e6-96231b3b80d8
* Testcase for PR2629.Bill Wendling2008-08-051-0/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54377 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r53282. This was causing a miscompile on Linux. Also, the transformationBill Wendling2008-08-051-10/+0
| | | | | | | looks bogus. Please see PR2629 for details on why this is breaking things. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54372 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -unroll-allow-partial command line option that enabled the loop unroller toMatthijs Kooijman2008-07-291-0/+15
| | | | | | | | | partially unroll a loop when fully unrolling would not fit under the threshold. Patch by Mikael Lepistö. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54160 91177308-0d34-0410-b5e6-96231b3b80d8
* Restructure ArgumentPromotion a bit. Instead of just having a single booleanMatthijs Kooijman2008-07-291-0/+25
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54159 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for eliminating stores that store the same value that was just ↵Owen Anderson2008-07-281-0/+14
| | | | | | | | | loaded. This fixes PR2599. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54133 91177308-0d34-0410-b5e6-96231b3b80d8
* Put the LICM of constant GlobalVariables, introduced in r53945, under aDan Gohman2008-07-241-1/+1
| | | | | | | | command-line option, and disable it by default. It introduced performance regressions because CodeGen is currently not able to remat such loads. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53997 91177308-0d34-0410-b5e6-96231b3b80d8
* "Allow LICM to sink or lift loads from constant memory. Also add a testChris Lattner2008-07-231-0/+23
| | | | | | | | | | | | | 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! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53945 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable first-class aggregates support.Dan Gohman2008-07-231-2/+5
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53941 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the PR number to the test.Dan Gohman2008-07-211-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53880 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in LSR's dead-PHI cleanup. If a PHI has a def-use chain thatDan Gohman2008-07-211-0/+285
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53879 91177308-0d34-0410-b5e6-96231b3b80d8
* Make GlobalOpt preserve address spaces when scalar replacing aggregate globals.Matthijs Kooijman2008-07-171-0/+28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53716 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2553Chris Lattner2008-07-171-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53715 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a few cases to instcombine's extractvalue testcase.Matthijs Kooijman2008-07-161-2/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53675 91177308-0d34-0410-b5e6-96231b3b80d8
* Un-XFAIL multdeadretval, since instcombine now properly handles the mess ↵Matthijs Kooijman2008-07-161-1/+0
| | | | | | deadargelim leaves behind :-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53674 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2296. Do not transform x86_sse2_storel_dq into a full-width store.Evan Cheng2008-07-161-0/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53666 91177308-0d34-0410-b5e6-96231b3b80d8
* XFAIL the multdeadretval test for now, I will be fixing instcombine to make ↵Matthijs Kooijman2008-07-151-0/+1
| | | | | | it work again tomorrow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53614 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a few tests which no longer hold for deadargelim (since it is nowMatthijs Kooijman2008-07-151-15/+7
| | | | | | | | | allowed to canonicalize return values). Add a test that checks if return value and function attributes are not removed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53612 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a testcase for the canonicalizations now performed by deadargelim.Matthijs Kooijman2008-07-151-0/+24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53611 91177308-0d34-0410-b5e6-96231b3b80d8
* Make deadargelim a bit less smart, so it doesn't choke on nested structs asMatthijs Kooijman2008-07-151-1/+14
| | | | | | | | | | | | | 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
* Fix typo.Matthijs Kooijman2008-07-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53605 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2506 by being a bit more careful about reverse fact propagation whenChris Lattner2008-07-142-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+36
| | | | | | | fixes PR2540. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53533 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance analysis of srem.Nick Lewycky2008-07-121-0/+9
| | | | | | | | 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
* Add another optimization from PR2330. Also catch some missing cases that areNick Lewycky2008-07-111-0/+19
| | | | | | | similar. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53451 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix folding of icmp's of i1 where the comparison is signed. The codeChris Lattner2008-07-111-1/+10
| | | | | | | | was using the algorithm for folding unsigned comparisons which is completely wrong. This has been broken since the signless types change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53444 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bogus optimization: folding (slt (zext i1 A to i32), 1) -> (slt i1 A, ↵Chris Lattner2008-07-111-0/+8
| | | | | | | | | | | | | | true) This cause a regression in InstCombine/JavaCompare, which was doing the right thing on accident. To handle the missed case, generalize the comparisons based on masked bits a little bit to handle comparisons against the max value. For example, we can now xform (slt i32 (and X, 4), 4) -> (setne i32 (and X, 4), 4) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53443 91177308-0d34-0410-b5e6-96231b3b80d8
* make this condition more precise.Chris Lattner2008-07-111-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53442 91177308-0d34-0410-b5e6-96231b3b80d8
* Restructure dead argument elimination, try #3 :-)Matthijs Kooijman2008-07-101-2/+17
| | | | | | | | | | | | | | | | | | Rewrite the DeadArgumentElimination pass, to use a more explicit tracking of dependencies between return values and/or arguments. Also make the handling of arguments and return values the same. The pass now looks properly inside returned structs, but only at the first level (ie, not inside nested structs). This version fixed a few more bugs and was cleaned up a bit. It now passes all of LLVM's testing, and should still pass SPEC2006. There is still a minor bug with regard to returning nested structs. Since there is currently nothing that emits such IR, I will fix that in a seperate commit (partly because it requires a non-trivial fix). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53400 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix overzealous optimization. Thanks to Duncan Sands for pointing out my error!Nick Lewycky2008-07-101-0/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53393 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a case where vector comparison constant folding would cause anChris Lattner2008-07-101-0/+6
| | | | | | | infinite recursion. part of PR2529 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53383 91177308-0d34-0410-b5e6-96231b3b80d8
* elementwise comparison of vector constants was completely wrong. FixChris Lattner2008-07-101-1/+9
| | | | | | | it for PR2529 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53380 91177308-0d34-0410-b5e6-96231b3b80d8
* Fold (a < 8) && (b < 8) into (a|b) < 8 for unsigned less or greater than.Nick Lewycky2008-07-091-0/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53282 91177308-0d34-0410-b5e6-96231b3b80d8