summaryrefslogtreecommitdiff
path: root/test/Transforms/IndVarSimplify
Commit message (Collapse)AuthorAge
* Remove LoopIndexSplit pass. It is neither maintained nor used by anyone.Devang Patel2010-10-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116004 91177308-0d34-0410-b5e6-96231b3b80d8
* more test cleanupChris Lattner2010-09-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112892 91177308-0d34-0410-b5e6-96231b3b80d8
* Print the number of uses of a function in the .ll since it can be informativeDuncan Sands2010-09-02
| | | | | | | and there seems to be no reason not to. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112812 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct bogus module triple specifications.Duncan Sands2010-08-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112469 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix SCEVExpander::visitAddRecExpr so that it remembers the induction variableDan Gohman2010-07-26
| | | | | | | | | it inserted rather than using LoopInfo::getCanonicalInductionVariable to rediscover it, since that doesn't work on non-canonical loops. This fixes infinite recurrsion on such loops; PR7562. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109419 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix this test.Dan Gohman2010-07-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108491 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the order that SCEVExpander considers add operands in so thatDan Gohman2010-07-15
| | | | | | | | it doesn't miss an opportunity to form a GEP, regardless of the relative loop depths of the operands. This fixes rdar://8197217. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108475 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix ScalarEvolution's tripcount computation for chains of loopsDan Gohman2010-06-29
| | | | | | | | where each loop's induction variable's start value is the exit value of a preceding loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107224 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable indvars on loops when LoopSimplify form is not available.Dan Gohman2010-06-18
| | | | | | | This fixes PR7333. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106267 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove arm_apcscc from the test files. It is the default and doing thisRafael Espindola2010-06-17
| | | | | | matches what llvm-gcc and clang now produce. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106221 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the Expr member from IVUsers. Instead of remembering the expression,Dan Gohman2010-04-19
| | | | | | | | just ask ScalarEvolution for it on demand. This helps IVUsers be more robust in the case of expressions changing underneath it. This fixes PR6862. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101819 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix declarations in a few more tests.Nick Lewycky2010-04-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101676 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach ScalarEvolution to simplify smax and umax when it can proveDan Gohman2010-04-13
| | | | | | | that one operand is always greater than another. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101142 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach IndVarSimplify how to eliminate remainder operators where theDan Gohman2010-04-13
| | | | | | | | | | | | | numerator is an induction variable. For example, with code like this: for (i=0;i<n;++i) x[i%n] = 0; IndVarSimplify will now recognize that i is always less than n inside the loop, and eliminate the remainder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101113 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress LinearFunctionTestReplace when the computed backedge-takenDan Gohman2010-04-12
| | | | | | | | | | | | | expression is a UDiv and it doesn't appear that the UDiv came from the user's source. ScalarEvolution has recently figured out how to compute a tripcount expression for the inner loop in SingleSource/Benchmarks/Shootout/sieve.c, using a udiv. Emitting a udiv instruction dramatically slows down the enclosing loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101068 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply r101000, with a fix: Don't eliminate an icmp which is part ofDan Gohman2010-04-12
| | | | | | | | | the loop exit test. This usually doesn't come up for a variety of reasons, but it isn't impossible, so make IndVarSimplify handle it conservatively. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101008 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 101000, which is breaking self-host builds.Dan Gohman2010-04-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101002 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach IndVarSimplify how to eliminate comparisons involving inductionDan Gohman2010-04-11
| | | | | | | | | | | | | | variables. For example, with code like this: for (i=0;i<n;++i) if (i<n) x[i] = 0; IndVarSimplify will now recognize that i is always less than n inside the loop, and eliminate the if. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101000 91177308-0d34-0410-b5e6-96231b3b80d8
* add newlines at the end of files.Chris Lattner2010-04-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100705 91177308-0d34-0410-b5e6-96231b3b80d8
* add integer overflow check for the fp induction variable Chris Lattner2010-04-03
| | | | | | | | | | | | | checker. Amusingly, we already had tests that we should have rejects because they would be miscompiled in the testsuite. The remaining issue with this is that we don't check that the branch causes us to exit the loop if it fails, so we don't actually know if we remain in bounds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100284 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR6761, a miscompilation due to the fp->int IV conversionChris Lattner2010-04-03
| | | | | | | stuff. More bugs remain though. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100282 91177308-0d34-0410-b5e6-96231b3b80d8
* convert to filecheckChris Lattner2010-04-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100281 91177308-0d34-0410-b5e6-96231b3b80d8
* rename feature test.Chris Lattner2010-04-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100279 91177308-0d34-0410-b5e6-96231b3b80d8
* actually just remove this, will move the real feature test here.Chris Lattner2010-04-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100278 91177308-0d34-0410-b5e6-96231b3b80d8
* rename test since it is a feature test.Chris Lattner2010-04-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100277 91177308-0d34-0410-b5e6-96231b3b80d8
* first half of a pass through IndVarSimplify::HandleFloatingPointIV,Chris Lattner2010-04-03
| | | | | | | | | this cleans up a bunch of code and also fixes several crashes and miscompiles. More to come unfortunately, this optimization is quite broken. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100270 91177308-0d34-0410-b5e6-96231b3b80d8
* Manually notify ScalarEvolution before making an operand replacement, sinceDan Gohman2010-04-02
| | | | | | | it can't currently observe such changes automatically. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100186 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LoopSimplify change conditional branches in loop exiting blocksDan Gohman2010-02-25
| | | | | | | | | | | | | which branch on undef to branch on a boolean constant for the edge exiting the loop. This helps ScalarEvolution compute trip counts for loops. Teach ScalarEvolution to recognize single-value PHIs, when safe, and ForgetSymbolicName to forget such single-value PHI nodes as apprpriate in ForgetSymbolicName. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97126 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach ScalarEvolution how to compute a tripcount for a loop withDan Gohman2010-02-19
| | | | | | | | | true or false as its exit condition. These are usually eliminated by SimplifyCFG, but the may be left around during a pass which wishes to preserve the CFG. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96683 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply the new LoopStrengthReduction code, with compile time andDan Gohman2010-02-12
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95975 91177308-0d34-0410-b5e6-96231b3b80d8
* -disable-output is no longer needed with -analyze.Dan Gohman2010-01-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94574 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-implement the main strength-reduction portion of LoopStrengthReduction.Dan Gohman2010-01-21
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94061 91177308-0d34-0410-b5e6-96231b3b80d8
* Use WriteAsOperand instead of getName() to print loop header names,Dan Gohman2010-01-09
| | | | | | | so that unnamed blocks are handled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93059 91177308-0d34-0410-b5e6-96231b3b80d8
* Move this test from test/Transforms/IndVarSimplify toDan Gohman2010-01-05
| | | | | | | | test/CodeGen/X86, as doesn't use -indvars, and it does use llc -march=x86-64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92799 91177308-0d34-0410-b5e6-96231b3b80d8
* Make getUniqueExitBlocks's precondition assert more precise, toDan Gohman2009-12-11
| | | | | | | avoid spurious failures. This fixes PR5758. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91147 91177308-0d34-0410-b5e6-96231b3b80d8
* Make opt default to not adding a target data string and update tests that ↵Kenneth Uildriks2009-11-03
| | | | | | depend on target data to supply it within the test git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85900 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a testcase for r83011.Dan Gohman2009-09-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83012 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a case where ScalarEvolution was expanding pointer arithmeticDan Gohman2009-09-26
| | | | | | | to inttoptr/ptrtoint unnecessarily. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82864 91177308-0d34-0410-b5e6-96231b3b80d8
* Change tests from "opt %s" to "opt < %s" so that opt doesn't see theDan Gohman2009-09-11
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81537 91177308-0d34-0410-b5e6-96231b3b80d8
* Use "opt < %s" instead of "opt %s" so that opt doesn't print the testDan Gohman2009-09-08
| | | | | | | filename in the output, which interferes with the tests' grep lines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81263 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert a few more opt | llvm-dis to opt -S.Dan Gohman2009-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81261 91177308-0d34-0410-b5e6-96231b3b80d8
* Use opt -S instead of piping bitcode output through llvm-dis.Dan Gohman2009-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81257 91177308-0d34-0410-b5e6-96231b3b80d8
* Change these tests to feed the assembly files to opt directly, insteadDan Gohman2009-09-08
| | | | | | | of using llvm-as, now that opt supports this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81226 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate uses of %prcontext.Daniel Dunbar2009-09-05
| | | | | | | - I'd appreciate it if someone else eyeballs my changes to make sure I captured the intent of the test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81083 91177308-0d34-0410-b5e6-96231b3b80d8
* Special-case static allocas in IndVarSimplify's loop invariantDan Gohman2009-08-25
| | | | | | | | | sinking code, since they are special. If the loop preheader happens to be the entry block of a function, don't sink static allocas out of it. This fixes PR4775. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80010 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize ScalarEvolution to be able to analyze GEPs whenDan Gohman2009-08-18
| | | | | | | | | TargetData is not present. It still uses TargetData when available. This generalization also fixed some limitations in the TargetData case; the attached testcase covers this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79344 91177308-0d34-0410-b5e6-96231b3b80d8
* The upper argument of ConstantRange is exclusive, not inclusive.Dan Gohman2009-07-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76492 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert the addition of hasNoPointerOverflow to GEPOperator.Dan Gohman2009-07-20
| | | | | | | | | | | | | Getelementptrs that are defined to wrap are virtually useless to optimization, and getelementptrs that are undefined on any kind of overflow are too restrictive -- it's difficult to ensure that all intermediate addresses are within bounds. I'm going to take a different approach. Remove a few optimizations that depended on this flag. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76437 91177308-0d34-0410-b5e6-96231b3b80d8
* Fill in some holes in ScalarEvolution's loop iteration conditionDan Gohman2009-07-16
| | | | | | | | analysis. This allows indvars to emit a simpler loop trip count expression. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76085 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch invars away from using isTrapping when it really shouldn't be Eli Friedman2009-07-15
| | | | | | | | using it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75852 91177308-0d34-0410-b5e6-96231b3b80d8