summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LoopStrengthReduce
Commit message (Collapse)AuthorAgeFilesLines
* Unit test for PR11950: LSR crash.Andrew Trick2012-03-261-0/+49
| | | | llvm-svn: 153472
* Continue cleanup of LIT, getting rid of the remaining artifacts from dejagnuEli Bendersky2012-03-252-16/+2
| | | | | | | | | | | | | | * Removed test/lib/llvm.exp - it is no longer needed * Deleted the dg.exp reading code from test/lit.cfg. There are no dg.exp files left in the test suite so this code is no longer required. test/lit.cfg is now much shorter and clearer * Removed a lot of duplicate code in lit.local.cfg files that need access to the root configuration, by adding a "root" attribute to the TestingConfig object. This attribute is dynamically computed to provide the same information as was previously provided by the custom getRoot functions. * Documented the config.root attribute in docs/CommandGuide/lit.pod llvm-svn: 153408
* Convert -indvars tests that rely on SCEV expansion to -loop-reduce tests.Andrew Trick2012-03-222-0/+124
| | | | llvm-svn: 153259
* LSR: teach isSimplifiedLoopNest to handle PHI IVUsers.Andrew Trick2012-03-201-0/+32
| | | | llvm-svn: 153132
* LSR: fix IVUsers isSimplifiedLoopNest to perform a full domtree walkAndrew Trick2012-03-201-0/+73
| | | | | | | | | instead of skipping the current loop. My prior fix was incomplete because of an overzealous compile-time optimization: Better fix for: <rdar://problem/11049788> Segmentation fault: 11 in LoopStrengthReduce llvm-svn: 153131
* LSR fix: Add isSimplifiedLoopNest to IVUsers analysis.Andrew Trick2012-03-161-0/+50
| | | | | | | | | | | | | | Only record IVUsers that are dominated by simplified loop headers. Otherwise SCEVExpander will crash while looking for a preheader. I previously tried to work around this in LSR itself, but that was insufficient. This way, LSR can continue to run if some uses are not in simple loops, as long as we don't attempt to analyze those users. Fixes <rdar://problem/11049788> Segmentation fault: 11 in LoopStrengthReduce llvm-svn: 152892
* Move llc + target triple tests into X86Andrew Trick2012-03-102-0/+0
| | | | llvm-svn: 152502
* Fix this assert. IP can point to an instruction with strange dominanceRafael Espindola2012-02-271-0/+30
| | | | | | | properties (invoke). Just assert that the instruction we return dominates the insertion point. llvm-svn: 151511
* Change the implementation of dominates(inst, inst) to one based on what theRafael Espindola2012-02-261-0/+40
| | | | | | | | verifier does. This correctly handles invoke. Thanks to Duncan, Andrew and Chris for the comments. Thanks to Joerg for the early testing. llvm-svn: 151469
* Semantically revert 151015. Add a comment on why we should be able to assertRafael Espindola2012-02-221-0/+38
| | | | | | | | the dominance once the dominates method is fixed and why we can use the builder's insertion point. Fixes pr12048. llvm-svn: 151125
* Don't skip debug instructions when looking for the insertion point ofRafael Espindola2012-02-181-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the cast. If we do, we can end up with inst1 --------------- < Insertion point dbg inst new inst instead of the desired inst1 new inst --------------- < Insertion point dbg inst Another option would be for InsertNoopCastOfTo (or its callers) to move the insertion point and we would end up with inst1 dbg inst new inst --------------- < Insertion point but that complicates the callers. This fixes PR12018 (and firefox's build). llvm-svn: 150884
* Replace all instances of dg.exp file with lit.local.cfg, since all tests are ↵Eli Bendersky2012-02-166-13/+27
| | | | | | | | 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
* Handle a corner case with IV chain collection with bailout instead of assert.Andrew Trick2012-01-201-0/+43
| | | | | | Fixes PR11783: bad cast to AddRecExpr. llvm-svn: 148572
* Test case comments missing from my previous checkin.Andrew Trick2012-01-201-0/+5
| | | | llvm-svn: 148571
* SCEVExpander fixes. Affects LSR and indvars.Andrew Trick2012-01-201-0/+37
| | | | | | | | | | | | | | | | LSR has gradually been improved to more aggressively reuse existing code, particularly existing phi cycles. This exposed problems with the SCEVExpander's sloppy treatment of its insertion point. I applied some rigor to the insertion point problem that will hopefully avoid an endless bug cycle in this area. Changes: - Always used properlyDominates to check safe code hoisting. - The insertion point provided to SCEV is now considered a lower bound. This is usually a block terminator or the use itself. Under no cirumstance may SCEVExpander insert below this point. - LSR is reponsible for finding a "canonical" insertion point across expansion of different expressions. - Robust logic to determine whether IV increments are in "expanded" form and/or can be safely hoisted above some insertion point. Fixes PR11783: SCEVExpander assert. llvm-svn: 148535
* Test case renameAndrew Trick2012-01-171-0/+0
| | | | llvm-svn: 148344
* LSR fix: broaden the check for loop preheaders.Andrew Trick2012-01-171-0/+113
| | | | | | | It's becoming clear that LoopSimplify needs to unconditionally create loop preheaders. But that is a bigger fix. For now, continuing to hack LSR. Fixes rdar://10701050 "Cannot split an edge from an IndirectBrInst" assert. llvm-svn: 148288
* Fix a corner case hit by redundant phi elimination running after LSR.Andrew Trick2012-01-141-0/+50
| | | | | | Fixes PR11761: bad IR w/ redundant Phi elim llvm-svn: 148177
* Enable LSR IV Chains with sufficient heuristics.Andrew Trick2012-01-103-0/+597
| | | | | | | | | | | | | | | | | | | | | | | | | These heuristics are sufficient for enabling IV chains by default. Performance analysis has been done for i386, x86_64, and thumbv7. The optimization is rarely important, but can significantly speed up certain cases by eliminating spill code within the loop. Unrolled loops are prime candidates for IV chains. In many cases, the final code could still be improved with more target specific optimization following LSR. The goal of this feature is for LSR to make the best choice of induction variables. Instruction selection may not completely take advantage of this feature yet. As a result, there could be cases of slight code size increase. Code size can be worse on x86 because it doesn't support postincrement addressing. In fact, when chains are formed, you may see redundant address plus stride addition in the addressing mode. GenerateIVChains tries to compensate for the common cases. On ARM, code size increase can be mitigated by using postincrement addressing, but downstream codegen currently misses some opportunities. llvm-svn: 147826
* Adding IV chain generation to LSR.Andrew Trick2012-01-091-0/+96
| | | | | | | | | | | | | | | | | | After collecting chains, check if any should be materialized. If so, hide the chained IV users from the LSR solver. LSR will only solve for the head of the chain. GenerateIVChains will then materialize the chained IV users by computing the IV relative to its previous value in the chain. In theory, chained IV users could be exposed to LSR's solver. This would be considerably complicated to implement and I'm not aware of a case where we need it. In practice it's more important to intelligently prune the search space of nontrivial loops before running the solver, otherwise the solver is often forced to prune the most optimal solutions. Hiding the chained users does this well, so that LSR is more likely to find the best IV for the chain as a whole. llvm-svn: 147801
* LSR: Don't optimize loops if an outer loop has no preheader.Andrew Trick2012-01-071-3/+41
| | | | | | | | LoopSimplify may not run on some outer loops, e.g. because of indirect branches. SCEVExpander simply cannot handle outer loops with no preheaders. Fixes rdar://10655343 SCEVExpander segfault. llvm-svn: 147718
* comment typoAndrew Trick2012-01-071-1/+1
| | | | llvm-svn: 147701
* Fix SCEVExpander to handle loops with no preheader when LSR gives it aAndrew Trick2012-01-021-0/+50
| | | | | | | | "phony" insertion point. Fixes rdar://10619599: "SelectionDAGBuilder shouldn't visit PHI nodes!" assert llvm-svn: 147439
* Unit test for r146950: LSR postinc expansion, PR11571.Andrew Trick2011-12-201-0/+39
| | | | llvm-svn: 146951
* LSR: Fold redundant bitcasts on-the-fly.Andrew Trick2011-12-141-4/+4
| | | | llvm-svn: 146597
* LSR: prune undesirable formulae early.Andrew Trick2011-12-061-0/+96
| | | | | | | | | It's always good to prune early, but formulae that are unsatisfactory in their own right need to be removed before running any other pruning heuristics. We easily avoid generating such formulae, but we need them as an intermediate basis for forming other good formulae. llvm-svn: 145906
* Better test case found in duplicate PR10570.Andrew Trick2011-11-301-43/+23
| | | | llvm-svn: 145484
* LSR: handle the expansion of phi operands that use postinc forms of the IV.Andrew Trick2011-11-301-0/+56
| | | | | | Fixes PR11431: SCEVExpander::expandAddRecExprLiterally(const llvm::SCEVAddRecExpr*): Assertion `(!isa<Instruction>(Result) || SE.DT->dominates(cast<Instruction>(Result), Builder.GetInsertPoint())) && "postinc expansion does not dominate use"' failed. llvm-svn: 145482
* Upgrade syntax of tests using volatile instructions to use 'load volatile' ↵Chris Lattner2011-11-273-4/+4
| | | | | | instead of 'volatile load', which is archaic. llvm-svn: 145171
* Fix SCEVExpander assert during LSR: "argument of incompatible type".Andrew Trick2011-10-151-0/+27
| | | | | | | | | Just because we're dealing with a GEP doesn't mean we can assert the SCEV has a pointer type. The fix is simply to ignore the SCEV pointer type, which we really didn't need. Fixes PR11138 webkit crash. llvm-svn: 142058
* Reapply r141870, SCEV expansion of post-inc.Andrew Trick2011-10-131-0/+111
| | | | | | | Speculatively reapply to see if this test case still crashes on linux. I may have fixed it in my last checkin. llvm-svn: 141895
* Revert r141870. The test case crashes on linux with data corruption. A ↵Andrew Trick2011-10-131-111/+0
| | | | | | deeper issue was exposed. llvm-svn: 141873
* LSR: Reuse the post-inc expansion of expressions.Andrew Trick2011-10-131-0/+111
| | | | | | | | This avoids unnecessary expansion of expressions and allows the SCEV expander to work on expression DAGs, not just trees. Fixes PR11090. llvm-svn: 141870
* Removed colons from some target datalayout strings in test, since they don't ↵Lang Hames2011-10-124-4/+4
| | | | | | match the required format. llvm-svn: 141825
* Unit test for LSR phi reuse in r141442.Andrew Trick2011-10-081-0/+53
| | | | llvm-svn: 141472
* LSR should avoid redundant edge splitting.Andrew Trick2011-10-041-0/+43
| | | | | | | | This handles the case in which LSR rewrites an IV user that is a phi and splits critical edges originating from a switch. Fixes <rdar://problem/6453893> LSR is not splitting edges "nicely" llvm-svn: 141059
* Stop emitting instructions with the name "tmp" they eat up memory and have ↵Benjamin Kramer2011-09-271-7/+7
| | | | | | | | to be uniqued, without any benefit. If someone prefers %tmp42 to %42, run instnamer. llvm-svn: 140634
* LSR, correct fix for rdar://9786536. Silly casting bug.Andrew Trick2011-07-211-1/+1
| | | | llvm-svn: 135654
* LSR must sometimes sign-extend before generating double constants.Andrew Trick2011-07-211-1/+20
| | | | | | rdar://9786536 llvm-svn: 135650
* LSR crashes on an empty IVUsers list.Andrew Trick2011-07-211-0/+24
| | | | | | rdar://9786536 llvm-svn: 135644
* PR10386: Don't try to split an edge from an indirectbr.Eli Friedman2011-07-191-0/+52
| | | | llvm-svn: 135534
* When forming an ICmpZero LSRUse, normalize the non-IV operandDan Gohman2011-05-181-0/+91
| | | | | | | of the comparison, so that the resulting expression is fully normalized. This fixes PR9939. llvm-svn: 131576
* Move few target-dependant tests to appropriate directories.Galina Kistanova2011-05-062-0/+5
| | | | llvm-svn: 131002
* Avoid creating canonical induction variables for non-native types.Andrew Trick2011-03-184-4/+8
| | | | | | | | 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
* Teach RecursivelyDeleteDeadPHINodes to handle multiple self-references. PatchNick Lewycky2011-02-201-1/+1
| | | | | | by Andrew Clinton! llvm-svn: 126077
* Add a test for the LSR issue exposed by r125254.Cameron Zwarich2011-02-111-0/+32
| | | | llvm-svn: 125325
* Correct bogus module triple specifications.Duncan Sands2010-08-301-1/+1
| | | | llvm-svn: 112469
* Move x86-specific tests out of test/Transforms/LoopStrengthReduce andDan Gohman2010-08-057-241/+0
| | | | | | | | | into test/CodeGen/X86, so that they aren't run when the x86 target is not enabled. Fix uglygep.ll to not be x86-specific. llvm-svn: 110343
* When determining a canonical insert position, don't climb deeperDan Gohman2010-04-091-0/+30
| | | | | | | | into adjacent loops. Also, ensure that the insert position is dominated by the loop latch of any loop in the post-inc set which has a latch. llvm-svn: 100906
* When emitting code for an add, don't force a SCEVUnknown wrapper aroundDan Gohman2010-04-091-0/+37
| | | | | | | a hoisted intermediate result if the intermediate result isn't an Instruction. llvm-svn: 100884
OpenPOWER on IntegriCloud