aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms
AgeCommit message (Collapse)Author
2008-05-20Fix PR2346 by marking vaarg as volatile so that licm doesn't try toChris Lattner
hoist them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51356 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20Oops, commit the version of this test that actually works.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51351 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20Port SelectionDAG's ComputeNumSignBits-using code to instcombine,Dan Gohman
now that instcombine also has ComputeNumSignBits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51350 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20sabre brings to my attention that the 'tr' suffix is also obsoleteGabor Greif
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51349 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20Rename the last test with .llx extension to .ll, resolve duplicate test by ↵Gabor Greif
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
2008-05-20Teach instcombine 4 new xforms:Chris Lattner
(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
2008-05-19Do not erase induction variable increment if it is used outside the loop.Devang Patel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51280 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19convert fptosi(sitofp x) -> x if the fp value has enough bits in its mantissaChris Lattner
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
2008-05-19Fold FP comparisons where one operand is converted from an integerChris Lattner
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
2008-05-19be more aggressive about transforming add -> or when the operands have noChris Lattner
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
2008-05-19Fix PR2341 - when the length is 4 use an i32 notDuncan Sands
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
2008-05-18Fix PR2339Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51226 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-18remove empty file?Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51225 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-17Revert constant-folding change that will miscompile in some cases.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51223 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-17Constant fold inttoptr and ptrtoint.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51216 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-16Fix test.Evan Cheng
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51191 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-16Move this test from ADCE to loop deletion, where it is more appropriate.Owen Anderson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51181 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-16Use loop deletion instead of ADCE in these tests.Owen Anderson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51180 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-16Use loop deletion instead of ADCE for removing loops.Owen Anderson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51178 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-16implement PR2328.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51176 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14Situations can arise when you have a function called that returns a 'void', butBill Wendling
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
2008-05-14Simplify internalize pass. Add test case.Devang Patel
Patch by Matthijs Kooijman! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51114 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13Fix for PR 2323, infinite loop in tail dup.Dale Johannesen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51063 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13Add a testcase for non-local CSE of read-only calls.Owen Anderson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51025 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-10Testcase for PR2303.Duncan Sands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50951 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-09Implement PR2298. This transforms:Chris Lattner
~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
2008-05-08More than just loads can read from memory: readonly calls like strlenChris Lattner
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
2008-05-08Make instcombine's DSE respect loads as well as stores. It is not safe toChris Lattner
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
2008-05-07Fix a bug in the ComputeMaskedBits logic for multiply.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50793 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06Testcase for r50770.Owen Anderson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50771 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06Correct the value of LowBits in srem and urem handling inDan Gohman
ComputeMaskedBits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50692 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-05Fix a crash when threading a block that includes a MRV call result.Chris Lattner
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
2008-05-02Fix a mistake in the computation of leading zeros for udiv.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50591 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-02strength reduce exp2 into ldexp, rdar://5852514Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50586 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01Update old-style syntax in some "not grep" tests.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50560 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01New test for bug fixed in 50545.Dale Johannesen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50548 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01Fix an overaggressive SimplifyDemandedBits optimization on urem. ThisDan Gohman
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
2008-05-01fix typoChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50519 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01instcombine does memset optzns.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50518 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01simplifylibcalls doesn't optimize llvm.memmove, instcombine does.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50517 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01move some tests from libcall optimizer suite.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50516 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30Move this test to LoopDeletion, where it now passes.Owen Anderson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50474 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30move lowering of llvm.memset -> store from simplify libcalls Chris Lattner
to instcombine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50472 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30no reason for simplifylibcalls to simplify intrinsics, instcombine doesChris Lattner
a fine job. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50470 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30remove redundant check.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50469 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29Fix a bug in memcpyopt where the memcpy-memcpy transform was never being ↵Owen Anderson
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
2008-04-29don't eliminate load from volatile value on paths where the load is dead.Chris Lattner
This fixes the second half of PR2262 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50430 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29make this test reduced and *valid*Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50429 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29fix a subtle volatile handling bug.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50428 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29don't delete the last store to an alloca if the store is volatile.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50390 91177308-0d34-0410-b5e6-96231b3b80d8