summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LoopSimplify
Commit message (Collapse)AuthorAgeFilesLines
...
* FileCheckize. NFC.Chad Rosier2014-09-121-21/+25
| | | | llvm-svn: 217698
* No need for those tests to go thru llvm-as and/or llvm-dis.Arnaud A. de Grandmaison2014-05-271-1/+1
| | | | | | opt can handle them by itself. llvm-svn: 209689
* [LPM] Switch LICM to actively use LCSSA in addition to preserving it.Chandler Carruth2014-02-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | Fixes PR18753 and PR18782. This is necessary for LICM to preserve LCSSA correctly and efficiently. There is still some active discussion about whether we should be using LCSSA, but we can't just immediately stop using it and we *need* LICM to preserve it while we are using it. We can restore the old SSAUpdater driven code if and when there is a serious effort to remove the reliance on LCSSA from all of the loop passes. However, this also serves as a great example of why LCSSA is very nice to have. This change significantly simplifies the process of sinking instructions for LICM, and makes it quite a bit less expensive. It wouldn't even be as complex as it is except that I had to start the process of removing the big recursive LCSSA formation hammer in order to switch even this much of the re-forming code to asserting that LCSSA was preserved. I'll fully remove that next just to tidy things up until the LCSSA debate settles one way or the other. llvm-svn: 201148
* [LPM] Make LCSSA a utility with a FunctionPass that applies it to allChandler Carruth2014-01-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the loops in a function, and teach LICM to work in the presance of LCSSA. Previously, LCSSA was a loop pass. That made passes requiring it also be loop passes and unable to depend on function analysis passes easily. It also caused outer loops to have a different "canonical" form from inner loops during analysis. Instead, we go into LCSSA form and preserve it through the loop pass manager run. Note that this has the same problem as LoopSimplify that prevents enabling its verification -- loop passes which run at the end of the loop pass manager and don't preserve these are valid, but the subsequent loop pass runs of outer loops that do preserve this pass trigger too much verification and fail because the inner loop no longer verifies. The other problem this exposed is that LICM was completely unable to handle LCSSA form. It didn't preserve it and it actually would give up on moving instructions in many cases when they were used by an LCSSA phi node. I've taught LICM to support detecting LCSSA-form PHI nodes and to hoist and sink around them. This may actually let LICM fire significantly more because we put everything into LCSSA form to rotate the loop before running LICM. =/ Now LICM should handle that fine and preserve it correctly. The down side is that LICM has to require LCSSA in order to preserve it. This is just a fact of life for LCSSA. It's entirely possible we should completely remove LCSSA from the optimizer. The test updates are essentially accomodating LCSSA phi nodes in the output of LICM, and the fact that we now completely sink every instruction in ashr-crash below the loop bodies prior to unrolling. With this change, LCSSA is computed only three times in the pass pipeline. One of them could be removed (and potentially a SCEV run and a separate LoopPassManager entirely!) if we had a LoopPass variant of InstCombine that ran InstCombine on the loop body but refused to combine away LCSSA PHI nodes. Currently, this also prevents loop unrolling from being in the same loop pass manager is rotate, LICM, and unswitch. There is one thing that I *really* don't like -- preserving LCSSA in LICM is quite expensive. We end up having to re-run LCSSA twice for some loops after LICM runs because LICM can undo LCSSA both in the current loop and the parent loop. I don't really see good solutions to this other than to completely move away from LCSSA and using tools like SSAUpdater instead. llvm-svn: 200067
* Reapply r198478 "Fix PR18361: Invalidate LoopDispositions after LoopSimplify ↵Andrew Trick2014-01-062-0/+190
| | | | | | | | | | hoists things." Now with a fix for PR18384: ValueHandleBase::ValueIsDeleted. We need to invalidate SCEV's loop info when we delete a block, even if no values are hoisted. llvm-svn: 198631
* Revert "Fix PR18361: Invalidate LoopDispositions after LoopSimplify hoists ↵Alp Toker2014-01-041-80/+0
| | | | | | | | | | | | | | | | | things." This commit was the source of crasher PR18384: While deleting: label %for.cond127 An asserting value handle still pointed to this value! UNREACHABLE executed at llvm/lib/IR/Value.cpp:671! Reverting to get the builders green, feel free to re-land after fixing up. (Renato has a handy isolated repro if you need it.) This reverts commit r198478. llvm-svn: 198503
* Fix PR18361: Invalidate LoopDispositions after LoopSimplify hoists things.Andrew Trick2014-01-041-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getSCEV for an ashr instruction creates an intermediate zext expression when it truncates its operand. The operand is initially inside the loop, so the narrow zext expression has a non-loop-invariant loop disposition. LoopSimplify then runs on an outer loop, hoists the ashr operand, and properly invalidate the SCEVs that are mapped to value. The SCEV expression for the ashr is now an AddRec with the hoisted value as the now loop-invariant start value. The LoopDisposition of this wide value was properly invalidated during LoopSimplify. However, if we later get the ashr SCEV again, we again try to create the intermediate zext expression. We get the same SCEV that we did earlier, and it is still cached because it was never mapped to a Value. When we try to create a new AddRec we abort because we're using the old non-loop-invariant LoopDisposition. I don't have a solution for this other than to clear LoopDisposition when LoopSimplify hoists things. I think the long-term strategy should be to perform LoopSimplify on all loops before computing SCEV and before running any loop opts on individual loops. It's possible we may want to rerun LoopSimplify on individual loops, but it should rarely do anything, so rarely require invalidating SCEV. llvm-svn: 198478
* UpdatePHINodes in BasicBlockUtils should not crash on duplicate predecessorsHal Finkel2013-10-041-0/+46
| | | | | | | | | | | UpdatePHINodes has an optimization to reuse an existing PHI node, where it first deletes all of its entries and then replaces them. Unfortunately, in the case where we had duplicate predecessors (which are allowed so long as the associated PHI entries have the same value), the loop removing the existing PHI entries from the to-be-reused PHI would assert (if that PHI was not the one which had the duplicates). llvm-svn: 192001
* [tests] Cleanup initialization of test suffixes.Daniel Dunbar2013-08-161-1/+0
| | | | | | | | | | | | | | | | | - Instead of setting the suffixes in a bunch of places, just set one master list in the top-level config. We now only modify the suffix list in a few suites that have one particular unique suffix (.ml, .mc, .yaml, .td, .py). - Aside from removing the need for a bunch of lit.local.cfg files, this enables 4 tests that were inadvertently being skipped (one in Transforms/BranchFolding, a .s file each in DebugInfo/AArch64 and CodeGen/PowerPC, and one in CodeGen/SI which is now failing and has been XFAILED). - This commit also fixes a bunch of config files to use config.root instead of older copy-pasted code. llvm-svn: 188513
* Update Transforms tests to use CHECK-LABEL for easier debugging. No ↵Stephen Lin2013-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | functionality change. This update was done with the following bash script: find test/Transforms -name "*.ll" | \ while read NAME; do echo "$NAME" if ! grep -q "^; *RUN: *llc" $NAME; then TEMP=`mktemp -t temp` cp $NAME $TEMP sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \ while read FUNC; do sed -i '' "s/;\(.*\)\([A-Za-z0-9_]*\):\( *\)@$FUNC\([( ]*\)\$/;\1\2-LABEL:\3@$FUNC(/g" $TEMP done mv $TEMP $NAME fi done llvm-svn: 186268
* Convert all tests using TCL-style quoting to use shell-style quoting.Chandler Carruth2012-07-023-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | This was done through the aid of a terrible Perl creation. I will not paste any of the horrors here. Suffice to say, it require multiple staged rounds of replacements, state carried between, and a few nested-construct-parsing hacks that I'm not proud of. It happens, by luck, to be able to deal with all the TCL-quoting patterns in evidence in the LLVM test suite. If anyone is maintaining large out-of-tree test trees, feel free to poke me and I'll send you the steps I used to convert things, as well as answer any painful questions etc. IRC works best for this type of thing I find. Once converted, switch the LLVM lit config to use ShTests the same as Clang. In addition to being able to delete large amounts of Python code from 'lit', this will also simplify the entire test suite and some of lit's architecture. Finally, the test suite runs 33% faster on Linux now. ;] For my 16-hardware-thread (2x 4-core xeon e5520): 36s -> 24s llvm-svn: 159525
* LoopSimplify bug fix. Handle indirect loop back edges.Andrew Trick2012-03-201-0/+41
| | | | | | | | Do not call SplitBlockPredecessors on a loop preheader when one of the predecessors is an indirectbr. Otherwise, you will hit this assert: !isa<IndirectBrInst>(Preds[i]->getTerminator()) && "Cannot split an edge from an IndirectBrInst" llvm-svn: 153134
* Replace all instances of dg.exp file with lit.local.cfg, since all tests are ↵Eli Bendersky2012-02-162-3/+1
| | | | | | | | run with LIT now and now Dejagnu. dg.exp is no longer needed. Patch reviewed by Daniel Dunbar. It will be followed by additional cleanup patches. llvm-svn: 150664
* Make loop preheader insertion in LoopSimplify handle the case where the loop ↵Eli Friedman2011-12-151-0/+45
| | | | | | header is a landing pad correctly (by splitting the landingpad out of the loop header). Make some adjustments to the rest of LoopSimplify to make it clear that the rest of LoopSimplify isn't making bad assumptions about the presence of landing pads. PR11575. llvm-svn: 146621
* Removed colons from some target datalayout strings in test, since they don't ↵Lang Hames2011-10-121-1/+1
| | | | | | match the required format. llvm-svn: 141825
* Update to the new EH syntax.Bill Wendling2011-09-191-7/+3
| | | | llvm-svn: 140103
* Dramatically reduce this testcase.Bill Wendling2011-09-191-873/+14
| | | | llvm-svn: 140101
* Generalize test case to handle multiple indvars modes.Andrew Trick2011-09-131-3/+6
| | | | llvm-svn: 139578
* Reenable test.Bill Wendling2011-08-311-1/+0
| | | | llvm-svn: 138916
* Revert accidental commitBill Wendling2011-08-311-6/+0
| | | | llvm-svn: 138915
* Disable this test until Bill fixes it properly.Eli Friedman2011-08-311-0/+1
| | | | llvm-svn: 138914
* Update more tests to the new EH scheme.Bill Wendling2011-08-311-0/+6
| | | | llvm-svn: 138903
* Remove the old tail duplication pass. It is not used and is unable to updateRafael Espindola2011-08-301-1/+1
| | | | | | | ssa, so it has to be run really early in the pipeline. Any replacement should probably use the SSAUpdater. llvm-svn: 138841
* SCEV: Use AssertingVH to catch dangling BasicBlock* when passes forgetAndrew Trick2011-08-031-0/+88
| | | | | | to notify SCEV of a change. Add forgetLoop in a couple of those places. llvm-svn: 136797
* manually upgrade a bunch of tests to modern syntax, and remove some thatChris Lattner2011-06-171-5/+5
| | | | | | are either unreduced or only test old syntax. llvm-svn: 133228
* Avoid creating canonical induction variables for non-native types.Andrew Trick2011-03-181-1/+1
| | | | | | | | For example, on 32-bit architecture, don't promote all uses of the IV to 64-bits just because one use is a 64-bit cast. Alternate implementation of the patch by Arnaud de Grandmaison. llvm-svn: 127884
* Rename 'loopsimplify' to 'loop-simplify'.Cameron Zwarich2011-02-1017-17/+17
| | | | llvm-svn: 125317
* Fix PR8702 by not having LoopSimplify claim to preserve LCSSA form. As ↵Duncan Sands2011-01-021-0/+43
| | | | | | | | | | described in the PR, the pass could break LCSSA form when inserting preheaders. It probably would be easy enough to fix this, but since currently we always go into LCSSA form after running this pass, doing so is not urgent. llvm-svn: 122695
* Fix LoopSimplify to notify ScalarEvolution when splitting a loop backedgeDan Gohman2010-09-041-0/+50
| | | | | | | into an inner loop, as the new loop iteration may differ substantially. This fixes PR8078. llvm-svn: 113057
* LoopSimplify shouldn't split loop backedges that use indirectbr. PR7867.Dan Gohman2010-08-141-0/+35
| | | | llvm-svn: 111061
* LoopSimplify does not update domfrontier correctly.Tobias Grosser2010-07-161-0/+20
| | | | | | This fixes PR7649. llvm-svn: 108513
* Make Loop::getLoopLatch() work on loops which don't have preheaders, asDan Gohman2009-11-201-0/+17
| | | | | | | | | | | | it may be used in contexts where preheader insertion may have failed due to an indirectbr. Make LoopSimplify's LoopSimplify::SeparateNestedLoop properly fail in the case that it would require splitting an indirectbr edge. These fix PR5502. llvm-svn: 89484
* The introduction of indirectbr meant the introduction ofDan Gohman2009-11-051-0/+83
| | | | | | | | | unsplittable critical edges, which means the introduction of loops which cannot be transformed to LoopSimplify form. Fix LoopSimplify to avoid transforming such loops into invalid code. llvm-svn: 86176
* Make these tests more interesting by usingDan Gohman2009-10-241-1/+1
| | | | | | | -verify-dom-info and -verify-loop-info, which enable additional (expensive) consistency checks. llvm-svn: 85017
* Fix SplitBlockPredecessors' LoopInfo updating code to handle the caseDan Gohman2009-10-191-0/+20
| | | | | | | | where a loop's header is being split and it has predecessors which are not contained by the most-nested loop which contains the loop. This fixes PR5235. llvm-svn: 84505
* Move the dominator verification code out of special code embedded withinDan Gohman2009-09-281-1/+1
| | | | | | | | | | | | the PassManager code into a regular verifyAnalysis method. Also, reorganize loop verification. Make the LoopPass infrastructure call verifyLoop as needed instead of having LoopInfo::verifyAnalysis check every loop in the function after each looop pass. Add a new command-line argument, -verify-loop-info, to enable the expensive full checking. llvm-svn: 82952
* Change tests from "opt %s" to "opt < %s" so that opt doesn't see theDan Gohman2009-09-1114-14/+14
| | | | | | | | input filename so that opt doesn't print the input filename in the output so that grep lines in the tests don't unintentionally match strings in the input filename. llvm-svn: 81537
* Convert a few more opt | llvm-dis to opt -S.Dan Gohman2009-09-081-2/+1
| | | | llvm-svn: 81261
* Use opt -S instead of piping bitcode output through llvm-dis.Dan Gohman2009-09-082-2/+2
| | | | llvm-svn: 81257
* Change these tests to feed the assembly files to opt directly, insteadDan Gohman2009-09-0815-15/+15
| | | | | | of using llvm-as, now that opt supports this. llvm-svn: 81226
* Teach LoopSimplify how to merge multiple loop exits into a single exit,Dan Gohman2009-06-271-0/+45
| | | | | | | | | | | | | | | | when one of them can be converted to a trivial icmp and conditional branch. This addresses what is essentially a phase ordering problem. SimplifyCFG knows how to do this transformation, but it doesn't do so if the primary block has any instructions in it other than an icmp and a branch. In the given testcase, the block contains other instructions, however they are loop-invariant and can be hoisted. SimplifyCFG doesn't have LoopInfo though, so it can't hoist them. And, it's important that the blocks be merged before LoopRotation, as it doesn't support multiple-exit loops. llvm-svn: 74396
* Fix some incorrect logic in DominanceFrontier::splitBlock. Part of Eli Friedman2009-05-211-1/+1
| | | | | | PR4238. llvm-svn: 72223
* As with r70333, give the primary induction variable a use soDan Gohman2009-04-281-1/+2
| | | | | | that it can't be trivially eliminated. llvm-svn: 70334
* sabre brings to my attention that the 'tr' suffix is also obsoleteGabor Greif2008-05-201-1/+1
| | | | llvm-svn: 51349
* Rename the last test with .llx extension to .ll, resolve duplicate test by ↵Gabor Greif2008-05-201-1/+1
| | | | | | renaming to isnan2. Now that no test has llx ending there is no need to search for them from dg.exp too. llvm-svn: 51328
* Byebye llvm-upgrade!Tanya Lattner2008-03-2513-271/+211
| | | | llvm-svn: 48762
* Fix PR1752 and LoopSimplify/2007-10-28-InvokeCrash.ll: terminators Chris Lattner2007-10-291-0/+892
| | | | | | can have uses too. Wouldn't it be nice if invoke didn't exist? :) llvm-svn: 43426
* Convert tests using "| wc -l | grep ..." to use the count script.Dan Gohman2007-08-151-1/+1
| | | | llvm-svn: 41097
* Convert .cvsignore filesJohn Criswell2007-06-291-3/+0
| | | | llvm-svn: 37801
* For PR1319:Reid Spencer2007-04-151-2/+2
| | | | | | Upgrade to use new Tcl exec based test harness. llvm-svn: 36062
OpenPOWER on IntegriCloud