aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Oops, commit the version of this test that actually works.Dan Gohman2008-05-201-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51351 91177308-0d34-0410-b5e6-96231b3b80d8
* Port SelectionDAG's ComputeNumSignBits-using code to instcombine,Dan Gohman2008-05-201-0/+7
| | | | | | | now that instcombine also has ComputeNumSignBits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51350 91177308-0d34-0410-b5e6-96231b3b80d8
* sabre brings to my attention that the 'tr' suffix is also obsoleteGabor Greif2008-05-2044-44/+44
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51349 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename the last test with .llx extension to .ll, resolve duplicate test by ↵Gabor Greif2008-05-2044-44/+44
| | | | | | renaming to isnan2. Now that no test has llx ending there is no need to search for them from dg.exp too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51328 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach instcombine 4 new xforms:Chris Lattner2008-05-202-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (add (sext x), cst) --> (sext (add x, cst')) (add (sext x), (sext y)) --> (sext (add int x, y)) (add double (sitofp x), fpcst) --> (sitofp (add int x, intcst)) (add double (sitofp x), (sitofp y)) --> (sitofp (add int x, y)) This generally reduces conversions. For example MiBench/telecomm-gsm gets these simplifications: HACK2: %tmp67.i142.i.i = sext i16 %tmp6.i141.i.i to i32 ; <i32> [#uses=1] %tmp23.i139.i.i = sext i16 %tmp2.i138.i.i to i32 ; <i32> [#uses=1] %tmp8.i143.i.i = add i32 %tmp67.i142.i.i, %tmp23.i139.i.i ; <i32> [#uses=3] HACK2: %tmp67.i121.i.i = sext i16 %tmp6.i120.i.i to i32 ; <i32> [#uses=1] %tmp23.i118.i.i = sext i16 %tmp2.i117.i.i to i32 ; <i32> [#uses=1] %tmp8.i122.i.i = add i32 %tmp67.i121.i.i, %tmp23.i118.i.i ; <i32> [#uses=3] HACK2: %tmp67.i.i190.i = sext i16 %tmp6.i.i189.i to i32 ; <i32> [#uses=1] %tmp23.i.i187.i = sext i16 %tmp2.i.i186.i to i32 ; <i32> [#uses=1] %tmp8.i.i191.i = add i32 %tmp67.i.i190.i, %tmp23.i.i187.i ; <i32> [#uses=3] HACK2: %tmp67.i173.i.i.i = sext i16 %tmp6.i172.i.i.i to i32 ; <i32> [#uses=1] %tmp23.i170.i.i.i = sext i16 %tmp2.i169.i.i.i to i32 ; <i32> [#uses=1] %tmp8.i174.i.i.i = add i32 %tmp67.i173.i.i.i, %tmp23.i170.i.i.i ; <i32> [#uses=3] HACK2: %tmp67.i152.i.i.i = sext i16 %tmp6.i151.i.i.i to i32 ; <i32> [#uses=1] %tmp23.i149.i.i.i = sext i16 %tmp2.i148.i.i.i to i32 ; <i32> [#uses=1] %tmp8.i153.i.i.i = add i32 %tmp67.i152.i.i.i, %tmp23.i149.i.i.i ; <i32> [#uses=3] HACK2: %tmp67.i.i.i.i = sext i16 %tmp6.i.i.i.i to i32 ; <i32> [#uses=1] %tmp23.i.i5.i.i = sext i16 %tmp2.i.i.i.i to i32 ; <i32> [#uses=1] %tmp8.i.i7.i.i = add i32 %tmp67.i.i.i.i, %tmp23.i.i5.i.i ; <i32> [#uses=3] This also fixes a bug in ComputeNumSignBits handling select and makes it more aggressive with and/or. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51302 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not erase induction variable increment if it is used outside the loop.Devang Patel2008-05-191-0/+41
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51280 91177308-0d34-0410-b5e6-96231b3b80d8
* convert fptosi(sitofp x) -> x if the fp value has enough bits in its mantissaChris Lattner2008-05-191-0/+8
| | | | | | | | to accurately represent the integer. This triggers 9 times in 471.omnetpp, though 8 of those seem to be inlined from the same place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51271 91177308-0d34-0410-b5e6-96231b3b80d8
* Fold FP comparisons where one operand is converted from an integerChris Lattner2008-05-191-0/+25
| | | | | | | | | | | | | | | | | | | | | | type and the other operand is a constant into integer comparisons. This happens surprisingly frequently (e.g. 10 times in 471.omnetpp), which are things like this: %tmp8283 = sitofp i32 %tmp82 to double %tmp1013 = fcmp ult double %tmp8283, 0.0 Clearly comparing tmp82 against i32 0 is cheaper here. this also triggers 8 times in gobmk, including this one: %tmp375376 = sitofp i32 %tmp375 to double %tmp377 = fcmp ogt double %tmp375376, 8.150000e+01 which is comparing an integer against 81.5 :). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51268 91177308-0d34-0410-b5e6-96231b3b80d8
* be more aggressive about transforming add -> or when the operands have noChris Lattner2008-05-191-0/+15
| | | | | | | | | | | | | | | | | | | | | | intersecting bits. This triggers all over the place, for example in lencode, with adds of stuff like: %tmp580 = mul i32 %tmp579, 2 %tmp582 = and i32 %b8, 1 and %tmp28 = shl i32 %abs.i, 1 %sign.0 = select i1 %tmp23, i32 1, i32 0 and %tmp344 = shl i32 %tmp343, 2 %tmp346 = and i32 %tmp96, 3 etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51263 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2341 - when the length is 4 use an i32 notDuncan Sands2008-05-191-0/+14
| | | | | | | an i16! Cleaned up trailing whitespace while there. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51240 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2339Chris Lattner2008-05-181-0/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51226 91177308-0d34-0410-b5e6-96231b3b80d8
* remove empty file?Chris Lattner2008-05-181-0/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51225 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert constant-folding change that will miscompile in some cases.Nick Lewycky2008-05-171-8/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51223 91177308-0d34-0410-b5e6-96231b3b80d8
* Constant fold inttoptr and ptrtoint.Nick Lewycky2008-05-171-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51216 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix test.Evan Cheng2008-05-161-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51191 91177308-0d34-0410-b5e6-96231b3b80d8
* Move this test from ADCE to loop deletion, where it is more appropriate.Owen Anderson2008-05-161-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51181 91177308-0d34-0410-b5e6-96231b3b80d8
* Use loop deletion instead of ADCE in these tests.Owen Anderson2008-05-162-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51180 91177308-0d34-0410-b5e6-96231b3b80d8
* Use loop deletion instead of ADCE for removing loops.Owen Anderson2008-05-164-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51178 91177308-0d34-0410-b5e6-96231b3b80d8
* implement PR2328.Chris Lattner2008-05-161-2/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51176 91177308-0d34-0410-b5e6-96231b3b80d8
* Situations can arise when you have a function called that returns a 'void', butBill Wendling2008-05-142-2/+28
| | | | | | | | | | | is bitcast to return a floating point value. The result of the instruction may not be used by the program afterwards, and LLVM will happily remove all instructions except the call. But, on some platforms, if a value is returned as a floating point, it may need to be removed from the stack (like x87). Thus, we can't get rid of the bitcast even if there isn't a use of the value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51134 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify internalize pass. Add test case.Devang Patel2008-05-143-0/+32
| | | | | | | Patch by Matthijs Kooijman! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51114 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for PR 2323, infinite loop in tail dup.Dale Johannesen2008-05-131-0/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51063 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a testcase for non-local CSE of read-only calls.Owen Anderson2008-05-131-0/+49
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51025 91177308-0d34-0410-b5e6-96231b3b80d8
* Testcase for PR2303.Duncan Sands2008-05-101-0/+33
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50951 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement PR2298. This transforms:Chris Lattner2008-05-092-0/+20
| | | | | | | | | ~x < ~y --> y < x -x == -y --> x == y git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50882 91177308-0d34-0410-b5e6-96231b3b80d8
* More than just loads can read from memory: readonly calls like strlenChris Lattner2008-05-081-0/+28
| | | | | | | | also need to be checked for memory modifying instructions before we can sink them. THis fixes the second half of PR2297. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50860 91177308-0d34-0410-b5e6-96231b3b80d8
* Make instcombine's DSE respect loads as well as stores. It is not safe toChris Lattner2008-05-081-0/+25
| | | | | | | | | | | | | | delete the first store in: store x -> p load p store y -> p This is for PR2297. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50859 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in the ComputeMaskedBits logic for multiply.Dan Gohman2008-05-071-0/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50793 91177308-0d34-0410-b5e6-96231b3b80d8
* Testcase for r50770.Owen Anderson2008-05-061-0/+109
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50771 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct the value of LowBits in srem and urem handling inDan Gohman2008-05-061-0/+9
| | | | | | | ComputeMaskedBits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50692 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a crash when threading a block that includes a MRV call result.Chris Lattner2008-05-051-0/+25
| | | | | | | | | | DemoteRegToStack doesn't work with MRVs yet, because it relies on the ability to load/store things. This fixes PR2285. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50667 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a mistake in the computation of leading zeros for udiv.Dan Gohman2008-05-022-0/+39
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50591 91177308-0d34-0410-b5e6-96231b3b80d8
* strength reduce exp2 into ldexp, rdar://5852514Chris Lattner2008-05-021-0/+38
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50586 91177308-0d34-0410-b5e6-96231b3b80d8
* Update old-style syntax in some "not grep" tests.Dan Gohman2008-05-0114-14/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50560 91177308-0d34-0410-b5e6-96231b3b80d8
* New test for bug fixed in 50545.Dale Johannesen2008-05-011-0/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50548 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an overaggressive SimplifyDemandedBits optimization on urem. ThisDan Gohman2008-05-011-0/+32
| | | | | | | fixes the 254.gap regression on x86 and the 403.gcc regression on x86-64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50537 91177308-0d34-0410-b5e6-96231b3b80d8
* fix typoChris Lattner2008-05-011-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50519 91177308-0d34-0410-b5e6-96231b3b80d8
* instcombine does memset optzns.Chris Lattner2008-05-011-18/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50518 91177308-0d34-0410-b5e6-96231b3b80d8
* simplifylibcalls doesn't optimize llvm.memmove, instcombine does.Chris Lattner2008-05-011-22/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50517 91177308-0d34-0410-b5e6-96231b3b80d8
* move some tests from libcall optimizer suite.Chris Lattner2008-05-011-0/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50516 91177308-0d34-0410-b5e6-96231b3b80d8
* Move this test to LoopDeletion, where it now passes.Owen Anderson2008-04-302-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50474 91177308-0d34-0410-b5e6-96231b3b80d8
* move lowering of llvm.memset -> store from simplify libcalls Chris Lattner2008-04-301-0/+15
| | | | | | | to instcombine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50472 91177308-0d34-0410-b5e6-96231b3b80d8
* no reason for simplifylibcalls to simplify intrinsics, instcombine doesChris Lattner2008-04-301-3/+1
| | | | | | | a fine job. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50470 91177308-0d34-0410-b5e6-96231b3b80d8
* remove redundant check.Chris Lattner2008-04-301-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50469 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in memcpyopt where the memcpy-memcpy transform was never being ↵Owen Anderson2008-04-291-0/+17
| | | | | | | | | | applied because we were checking for it in the wrong order. This caused a miscompilation because the return slot optimization assumes that the call it is dealing with is NOT a memcpy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50444 91177308-0d34-0410-b5e6-96231b3b80d8
* don't eliminate load from volatile value on paths where the load is dead.Chris Lattner2008-04-291-0/+25
| | | | | | | This fixes the second half of PR2262 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50430 91177308-0d34-0410-b5e6-96231b3b80d8
* make this test reduced and *valid*Chris Lattner2008-04-291-15/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50429 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a subtle volatile handling bug.Chris Lattner2008-04-291-0/+30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50428 91177308-0d34-0410-b5e6-96231b3b80d8
* don't delete the last store to an alloca if the store is volatile.Chris Lattner2008-04-291-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50390 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix DSE to not eliminate volatile loads with no uses.Dan Gohman2008-04-281-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50370 91177308-0d34-0410-b5e6-96231b3b80d8