summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LoopStrengthReduce
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Fix a bug in IVUsers which was permitting non-affine addrecs toDan Gohman2010-04-091-0/+69
| | | | | | be sent to LSR, which it isn't prepared to handle. llvm-svn: 100839
* add newlines at the end of files.Chris Lattner2010-04-071-1/+1
| | | | llvm-svn: 100705
* Generalize IVUsers to track arbitrary expressions rather than expressionsDan Gohman2010-04-071-1/+1
| | | | | | | | | | | | | | | explicitly split into stride-and-offset pairs. Also, add the ability to track multiple post-increment loops on the same expression. This refines the concept of "normalizing" SCEV expressions used for to post-increment uses, and introduces a dedicated utility routine for normalizing and denormalizing expressions. This fixes the expansion of expressions which are post-increment users of more than one loop at a time. More broadly, this takes LSR another step closer to being able to reason about more than one loop at a time. llvm-svn: 100699
* Non-affine post-inc SCEV expansions have more code which must beDan Gohman2010-03-021-0/+44
| | | | | | | emitted after the increment. Make sure the insert position reflects this. This fixes PR6453. llvm-svn: 97537
* Reapply the new LoopStrengthReduction code, with compile time andDan Gohman2010-02-1210-14/+22
| | | | | | | | | | bug fixes, and with improved heuristics for analyzing foreign-loop addrecs. This change also flattens IVUsers, eliminating the stride-oriented groupings, which makes it easier to work with. llvm-svn: 95975
* -disable-output is no longer needed with -analyze.Dan Gohman2010-01-262-3/+3
| | | | llvm-svn: 94574
* Revert LoopStrengthReduce.cpp to pre-r94061 for now.Dan Gohman2010-01-223-6/+8
| | | | llvm-svn: 94123
* Re-implement the main strength-reduction portion of LoopStrengthReduction.Dan Gohman2010-01-215-39/+10
| | | | | | | | | | | | | | This new version is much more aggressive about doing "full" reduction in cases where it reduces register pressure, and also more aggressive about rewriting induction variables to count down (or up) to zero when doing so reduces register pressure. It currently uses fairly simplistic algorithms for finding reuse opportunities, but it introduces a new framework allows it to combine multiple strategies at once to form hybrid solutions, instead of doing all full-reduction or all base+index. llvm-svn: 94061
* Add nounwinds.Dan Gohman2010-01-192-2/+2
| | | | llvm-svn: 93919
* Make several tests less fragile.Dan Gohman2010-01-122-5/+9
| | | | llvm-svn: 93230
* Use WriteAsOperand instead of getName() to print loop header names,Dan Gohman2010-01-091-1/+1
| | | | | | so that unnamed blocks are handled. llvm-svn: 93059
* Generalize OptimizeLoopTermCond to optimize more loop terminating icmp to ↵Evan Cheng2009-11-171-0/+27
| | | | | | use postinc iv. llvm-svn: 89116
* Block terminator may be a switch.Evan Cheng2009-11-111-0/+130
| | | | llvm-svn: 86761
* Generalize lsr code that optimize loop to count down towards zero.Evan Cheng2009-11-101-0/+42
| | | | llvm-svn: 86715
* Change tests from "opt %s" to "opt < %s" so that opt doesn't see theDan Gohman2009-09-1133-36/+36
| | | | | | | | 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
* Eliminate more uses of llvm-as and llvm-dis.Dan Gohman2009-09-092-2/+2
| | | | llvm-svn: 81293
* Convert a few more opt | llvm-dis to opt -S.Dan Gohman2009-09-082-2/+2
| | | | llvm-svn: 81261
* Use opt -S instead of piping bitcode output through llvm-dis.Dan Gohman2009-09-0820-22/+22
| | | | llvm-svn: 81257
* Change these tests to feed the assembly files to opt directly, insteadDan Gohman2009-09-0836-39/+39
| | | | | | of using llvm-as, now that opt supports this. llvm-svn: 81226
* tighten test.Chris Lattner2009-09-071-1/+1
| | | | llvm-svn: 81159
* Eliminate uses of %prcontext.Daniel Dunbar2009-09-051-2/+3
| | | | | | | - I'd appreciate it if someone else eyeballs my changes to make sure I captured the intent of the test. llvm-svn: 81083
* Tweak this test to be a little less unusual.Dan Gohman2009-06-201-2/+2
| | | | llvm-svn: 73808
* Don't (unconditionally) use getSCEVAtScope to simplify the stepDan Gohman2009-06-191-0/+18
| | | | | | | | expression in IVUsers, because in the case of a use of a non-linear addrec outside of a loop, this causes the addrec to be evaluated as a linear addrec. llvm-svn: 73774
* Revert 72493 and replace it with a more conservative fix, for now: don'tDan Gohman2009-05-271-0/+25
| | | | | | | | rewrite the comparison if there is any implicit extension or truncation on the induction variable. I'm planning for IVUsers to eventually take over some of the work of this code, and for it to be generalized. llvm-svn: 72496
* In ChangeCompareStride, when the stride to be reused is truncated toDan Gohman2009-05-271-0/+33
| | | | | | | a smaller type, promoted its offset back up to the type of the new comparison. This fixes PR4222. llvm-svn: 72493
* Suppress the IV reversal transformation in the case that the RHSDan Gohman2009-05-201-0/+21
| | | | | | | | of the comparison is defined inside the loop. This fixes a use-before-def problem, because the transformation puts a use of the RHS outside the loop. llvm-svn: 72149
* Teach SCEVExpander to expand arithmetic involving pointers into GEPDan Gohman2009-05-191-1/+2
| | | | | | | | | | | | | | | | instructions. It attempts to create high-level multi-operand GEPs, though in cases where this isn't possible it falls back to casting the pointer to i8* and emitting a GEP with that. Using GEP instructions instead of ptrtoint+arithmetic+inttoptr helps pointer analyses that don't use ScalarEvolution, such as BasicAliasAnalysis. Also, make the AddrModeMatcher more aggressive in handling GEPs. Previously it assumed that operand 0 of a GEP would require a register in almost all cases. It now does extra checking and can do more matching if operand 0 of the GEP is foldable. This fixes a problem that was exposed by SCEVExpander using GEPs. llvm-svn: 72093
* Factor the code for collecting IV users out of LSR into an IVUsers class,Dan Gohman2009-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | and generalize it so that it can be used by IndVarSimplify. Implement the base IndVarSimplify transformation code using IVUsers. This removes TestOrigIVForWrap and associated code, as ScalarEvolution now has enough builtin overflow detection and folding logic to handle all the same cases, and more. Run "opt -iv-users -analyze -disable-output" on your favorite loop for an example of what IVUsers does. This lets IndVarSimplify eliminate IV casts and compute trip counts in more cases. Also, this happens to finally fix the remaining testcases in PR1301. Now that IndVarSimplify is being more aggressive, it occasionally runs into the problem where ScalarEvolutionExpander's code for avoiding duplicate expansions makes it difficult to ensure that all expanded instructions dominate all the instructions that will use them. As a temporary measure, IndVarSimplify now uses a FixUsesBeforeDefs function to fix up instructions inserted by SCEVExpander. Fortunately, this code is contained, and can be easily removed once a more comprehensive solution is available. llvm-svn: 71535
* Temporarily reverting r71008. It was causing this failure:Bill Wendling2009-05-051-122/+0
| | | | | | | | | | | | Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/ CodeGen/X86/dg.exp ... FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/ CodeGen/X86/change-compare-stride-1.ll Failed with exit(1) at line 2 while running: grep {cmpq $-478,} change-compare-stride-1.ll.tmp child process exited abnormally llvm-svn: 71013
* Handle overflow of 64-bit loop conditions.David Greene2009-05-051-0/+122
| | | | llvm-svn: 71008
* Previously, RecursivelyDeleteDeadInstructions provided an optionDan Gohman2009-05-021-1/+1
| | | | | | | | | | | | | | | | | | of returning a list of pointers to Values that are deleted. This was unsafe, because the pointers in the list are, by nature of what RecursivelyDeleteDeadInstructions does, always dangling. Replace this with a simple callback mechanism. This may eventually be removed if all clients can reasonably be expected to use CallbackVH. Use this to factor out the dead-phi-cycle-elimination code from LSR utility function, and generalize it to use the RecursivelyDeleteTriviallyDeadInstructions utility function. This makes LSR more aggressive about eliminating dead PHI cycles; adjust tests to either be less trivial or to simply expect fewer instructions. llvm-svn: 70636
* Don't try to mix integers and pointers in an icmp instructionDan Gohman2009-04-301-0/+1
| | | | | | in getSCEVAtScope. llvm-svn: 70495
OpenPOWER on IntegriCloud