aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Add a new icmp+select optz'n. Also shows off the load(cst) folding added inNick Lewycky2011-10-021-0/+10
| | | | | | | r140966. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140969 91177308-0d34-0410-b5e6-96231b3b80d8
* float comparison to double 'zero' constant can just be a float 'zero.'Jim Grosbach2011-09-301-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | InstCombine was incorrectly considering the conversion of the constant zero to be unsafe. We want to transform: define float @bar(float %x) nounwind readnone optsize ssp { %conv = fpext float %x to double %cmp = fcmp olt double %conv, 0.000000e+00 %conv1 = zext i1 %cmp to i32 %conv2 = sitofp i32 %conv1 to float ret float %conv2 } Into: define float @bar(float %x) nounwind readnone optsize ssp { %cmp = fcmp olt float %x, 0.000000e+00 ; <---- This %conv1 = zext i1 %cmp to i32 %conv2 = sitofp i32 %conv1 to float ret float %conv2 } rdar://10215914 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140869 91177308-0d34-0410-b5e6-96231b3b80d8
* Add forgotten tests that the cleanup flag is cleared if thereDuncan Sands2011-09-301-0/+24
| | | | | | | is a catch-all landingpad clause. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140858 91177308-0d34-0410-b5e6-96231b3b80d8
* Inlining often produces landingpad instructions with repeatedDuncan Sands2011-09-301-0/+157
| | | | | | | | | | | | | | | catch or repeated filter clauses. Teach instcombine a bunch of tricks for simplifying landingpad clauses. Currently the code only recognizes the GNU C++ and Ada personality functions, but that doesn't stop it doing a bunch of "generic" transforms which are hopefully fine for any real-world personality function. If these "generic" transforms turn out not to be generic, they can always be conditioned on the personality function. Probably someone should add the ObjC++ personality function. I didn't as I don't know anything about it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140852 91177308-0d34-0410-b5e6-96231b3b80d8
* When eliminating unnecessary retain+autorelease on return values,Dan Gohman2011-09-291-0/+59
| | | | | | | | handle the case where the retain is in a different basic block. rdar://10210274. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140815 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't eliminate objc_retainBlock calls on stack objects if theDan Gohman2011-09-291-0/+54
| | | | | | | | objc_retainBlock call is potentially responsible for copying the block to the heap to extend its lifetime. rdar://10209613. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140814 91177308-0d34-0410-b5e6-96231b3b80d8
* Test case for r140670: indvars should hoist sext.Andrew Trick2011-09-281-0/+28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140671 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop emitting instructions with the name "tmp" they eat up memory and have ↵Benjamin Kramer2011-09-278-37/+37
| | | | | | | | to be uniqued, without any benefit. If someone prefers %tmp42 to %42, run instnamer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140634 91177308-0d34-0410-b5e6-96231b3b80d8
* Split the landing pad basic block with the correct function. Also merge theBill Wendling2011-09-271-0/+67
| | | | | | | | split landingpad instructions into a PHI node. PR11016 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140592 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert more tests over to the new atomic instructions.Eli Friedman2011-09-261-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140559 91177308-0d34-0410-b5e6-96231b3b80d8
* Upgrade a couple more tests to the new atomic instructions.Eli Friedman2011-09-262-12/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140558 91177308-0d34-0410-b5e6-96231b3b80d8
* PR10987: add a missed safety check to isSafePHIToSpeculate in scalarrepl.Eli Friedman2011-09-221-0/+40
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140327 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure IPSCCP never marks a tracked call as overdefined in ↵Eli Friedman2011-09-201-0/+18
| | | | | | | | | | SCCPSolver::ResolvedUndefsIn. If we do, we can end up in a situation where a function is resolved to return a constant, but the caller is marked overdefined, which confuses the code later. <rdar://problem/9956541> (again). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140210 91177308-0d34-0410-b5e6-96231b3b80d8
* Update this test to the new EH model.Bill Wendling2011-09-201-0/+4
| | | | | | | | Though I think it may be obsolete with the loop extract changes. And I couldn't get the old version of LLVM to compile so that I could reduce this testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140197 91177308-0d34-0410-b5e6-96231b3b80d8
* Update to new EH model.Bill Wendling2011-09-201-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140177 91177308-0d34-0410-b5e6-96231b3b80d8
* Update to the new EH syntax.Bill Wendling2011-09-191-7/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140103 91177308-0d34-0410-b5e6-96231b3b80d8
* Dramatically reduce this testcase.Bill Wendling2011-09-191-873/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140101 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r140083 and r140084 until buildbots can be fixed.Bill Wendling2011-09-191-4/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140094 91177308-0d34-0410-b5e6-96231b3b80d8
* Update test to remove the 'unwind' instruction.Bill Wendling2011-09-191-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140084 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace uses of unwind with unreachable for the same effect.Bill Wendling2011-09-191-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140077 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace more uses of 'unwind' in the tests with calls to landingpad andBill Wendling2011-09-195-27/+29
| | | | | | | resume. Note that some of these tests were basically dead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140076 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an infinite loop where a transform in InstCombiner::visitAnd claims a ↵Eli Friedman2011-09-191-0/+7
| | | | | | | | | | construct is changed when it is not. (See included testcase.) Patch by Xiaoyi Guo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140072 91177308-0d34-0410-b5e6-96231b3b80d8
* This testcase is dead. It doesn't inline even if I add the 'alwaysinline'Bill Wendling2011-09-191-23/+0
| | | | | | | attribute to the @foo function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140067 91177308-0d34-0410-b5e6-96231b3b80d8
* [indvars] Fix PR10946: SCEV cannot handle Vector IVs.Andrew Trick2011-09-191-0/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140026 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r139759. Disable IV rewriting by default. See PR10916.Andrew Trick2011-09-152-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139842 91177308-0d34-0410-b5e6-96231b3b80d8
* Make demanded-elt simplification for shufflevector slightly stronger. ↵Eli Friedman2011-09-151-0/+11
| | | | | | Spotted by inspection. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139768 91177308-0d34-0410-b5e6-96231b3b80d8
* objc_retainBlock is not NoModRef because it can update forwarding pointersDan Gohman2011-09-141-0/+39
| | | | | | | in memory relevant to the optimizer. rdar://10050579. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139708 91177308-0d34-0410-b5e6-96231b3b80d8
* [indvars] Revert r139579 until 401.bzip -arch i386 miscompilation is fixed. ↵Andrew Trick2011-09-132-2/+2
| | | | | | PR10920. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139583 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable IV rewriting by default. See PR10916.Andrew Trick2011-09-132-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139579 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize test case to handle multiple indvars modes.Andrew Trick2011-09-131-3/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139578 91177308-0d34-0410-b5e6-96231b3b80d8
* [indvars] Fix bugs in floating point IV range checks noticed by inspection.Andrew Trick2011-09-131-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139574 91177308-0d34-0410-b5e6-96231b3b80d8
* Conditionalize indvars test that relies on SCEV expansion of geps,Andrew Trick2011-09-121-4/+13
| | | | | | | which is only relevant with canonical IVs git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139556 91177308-0d34-0410-b5e6-96231b3b80d8
* indvars test only relevant for -enable-iv-rewrite.Andrew Trick2011-09-121-1/+3
| | | | | | | Otherwise this case is now covered by no-iv-rewrite.ll. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139552 91177308-0d34-0410-b5e6-96231b3b80d8
* Conditionalize indvars tests that rely on SCEV expansion of geps,Andrew Trick2011-09-125-25/+26
| | | | | | | | which is relevant with canonical IVs. Anything else being checked by these tests is already covered by early CSE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139535 91177308-0d34-0410-b5e6-96231b3b80d8
* Removing indvars tests that directly test canonical IVs and nothing else.Andrew Trick2011-09-126-137/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139518 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename -disable-iv-rewrite to -enable-iv-rewrite=false in preparation for ↵Andrew Trick2011-09-1210-10/+10
| | | | | | default change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139517 91177308-0d34-0410-b5e6-96231b3b80d8
* Test case for r139453, WidenIV::GetExtendedOperandRecurrence.Andrew Trick2011-09-121-0/+30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139504 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark the eh.typeid.for intrinsic as being 'const', which it is insideDuncan Sands2011-09-091-0/+3
| | | | | | | | | any given function. As pointed out by John McCall, this is needed to have redundant eh.typeid.for tests be eliminated in the presence of cleanups. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139360 91177308-0d34-0410-b5e6-96231b3b80d8
* When inlining exception handling code into another function, ensure thatDuncan Sands2011-09-071-0/+78
| | | | | | | | | | | | duplicate tests are eliminated (for example if the two functions both have a catch clause catching the same type, ensure the redundant one is removed). Note that it would probably be safe to say that eh.typeid.for is 'const', but since two calls to it with the same argument can give different results (but only if the calls are in different functions), it seems more correct to mark it only 'pure'; this doesn't get in the way of the optimization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139236 91177308-0d34-0410-b5e6-96231b3b80d8
* Forgot to add this trampoline testcase.Duncan Sands2011-09-071-0/+87
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139229 91177308-0d34-0410-b5e6-96231b3b80d8
* Try again at r138809 (make DSE more aggressive in removing dead stores at ↵Owen Anderson2011-09-062-0/+112
| | | | | | the end of a function), now with less deleting stores before memcpy's. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139150 91177308-0d34-0410-b5e6-96231b3b80d8
* Split the init.trampoline intrinsic, which currently combines GCC'sDuncan Sands2011-09-061-2/+4
| | | | | | | | | | | | | | | | | | | | | init.trampoline and adjust.trampoline intrinsics, into two intrinsics like in GCC. While having one combined intrinsic is tempting, it is not natural because typically the trampoline initialization needs to be done in one function, and the result of adjust trampoline is needed in a different (nested) function. To get around this llvm-gcc hacks the nested function lowering code to insert an additional parent variable holding the adjust.trampoline result that can be accessed from the child function. Dragonegg doesn't have the luxury of tweaking GCC code, so it stored the result of adjust.trampoline in the memory GCC set aside for the trampoline itself (this is always available in the child function), and set up some new memory (using an alloca) to hold the trampoline. Unfortunately this breaks Go which allocates trampoline memory on the heap and wants to use it even after the parent has exited (!). Rather than doing even more hacks to get Go working, it seemed best to just use two intrinsics like in GCC. Patch mostly by Sanjoy Das. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139140 91177308-0d34-0410-b5e6-96231b3b80d8
* InstSimplify: Don't try to replace an extractvalue/insertvalue pair with the ↵Benjamin Kramer2011-09-051-4/+11
| | | | | | | | original value if types don't match. Fixes clang selfhost. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139120 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete trivial landing pads that just continue unwinding the caughtDuncan Sands2011-09-051-0/+22
| | | | | | | exception. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139117 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some simple insertvalue simplifications, for the purpose of cleaningDuncan Sands2011-09-051-0/+22
| | | | | | | up do-nothing exception handling code produced by dragonegg. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139113 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to eliminate the use of the 'unwind' instruction.Bill Wendling2011-09-0210-10/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139046 91177308-0d34-0410-b5e6-96231b3b80d8
* Test case update for unroll-scev.Andrew Trick2011-09-022-8/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139037 91177308-0d34-0410-b5e6-96231b3b80d8
* Extra CHECK-NOT to make sure that GVN transform works properly.Jakub Staszak2011-09-021-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139012 91177308-0d34-0410-b5e6-96231b3b80d8
* -unroll-scev flag removalAndrew Trick2011-09-024-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139010 91177308-0d34-0410-b5e6-96231b3b80d8
* ConstantVector returns arbitrary value for the wrong index.Jakub Staszak2011-09-021-0/+29
| | | | | | | This fixes PR10813. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139006 91177308-0d34-0410-b5e6-96231b3b80d8