summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/IndVarSimplify
Commit message (Collapse)AuthorAgeFilesLines
...
* Teach IndVarSimplify how to eliminate remainder operators where theDan Gohman2010-04-131-0/+121
| | | | | | | | | | | | 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. llvm-svn: 101113
* Suppress LinearFunctionTestReplace when the computed backedge-takenDan Gohman2010-04-121-0/+162
| | | | | | | | | | | | 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. llvm-svn: 101068
* Re-apply r101000, with a fix: Don't eliminate an icmp which is part ofDan Gohman2010-04-121-0/+84
| | | | | | | | 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. llvm-svn: 101008
* Revert 101000, which is breaking self-host builds.Dan Gohman2010-04-121-40/+0
| | | | llvm-svn: 101002
* Teach IndVarSimplify how to eliminate comparisons involving inductionDan Gohman2010-04-111-0/+40
| | | | | | | | | | | | | 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. llvm-svn: 101000
* add newlines at the end of files.Chris Lattner2010-04-071-1/+1
| | | | llvm-svn: 100705
* add integer overflow check for the fp induction variable Chris Lattner2010-04-031-4/+4
| | | | | | | | | | | | 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. llvm-svn: 100284
* fix PR6761, a miscompilation due to the fp->int IV conversionChris Lattner2010-04-031-4/+23
| | | | | | stuff. More bugs remain though. llvm-svn: 100282
* convert to filecheckChris Lattner2010-04-031-5/+13
| | | | llvm-svn: 100281
* rename feature test.Chris Lattner2010-04-031-0/+0
| | | | llvm-svn: 100279
* actually just remove this, will move the real feature test here.Chris Lattner2010-04-031-35/+0
| | | | llvm-svn: 100278
* rename test since it is a feature test.Chris Lattner2010-04-031-0/+0
| | | | llvm-svn: 100277
* first half of a pass through IndVarSimplify::HandleFloatingPointIV,Chris Lattner2010-04-031-0/+19
| | | | | | | | this cleans up a bunch of code and also fixes several crashes and miscompiles. More to come unfortunately, this optimization is quite broken. llvm-svn: 100270
* Manually notify ScalarEvolution before making an operand replacement, sinceDan Gohman2010-04-021-0/+41
| | | | | | it can't currently observe such changes automatically. llvm-svn: 100186
* Make LoopSimplify change conditional branches in loop exiting blocksDan Gohman2010-02-251-1/+1
| | | | | | | | | | | | 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. llvm-svn: 97126
* Teach ScalarEvolution how to compute a tripcount for a loop withDan Gohman2010-02-198-12/+12
| | | | | | | | 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. llvm-svn: 96683
* Reapply the new LoopStrengthReduction code, with compile time andDan Gohman2010-02-121-1/+1
| | | | | | | | | | 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-261-1/+1
| | | | llvm-svn: 94574
* Re-implement the main strength-reduction portion of LoopStrengthReduction.Dan Gohman2010-01-211-2/+3
| | | | | | | | | | | | | | 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
* 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
* Move this test from test/Transforms/IndVarSimplify toDan Gohman2010-01-051-19/+0
| | | | | | | test/CodeGen/X86, as doesn't use -indvars, and it does use llc -march=x86-64. llvm-svn: 92799
* Make getUniqueExitBlocks's precondition assert more precise, toDan Gohman2009-12-111-0/+22
| | | | | | avoid spurious failures. This fixes PR5758. llvm-svn: 91147
* Make opt default to not adding a target data string and update tests that ↵Kenneth Uildriks2009-11-032-0/+2
| | | | | | depend on target data to supply it within the test llvm-svn: 85900
* Add a testcase for r83011.Dan Gohman2009-09-281-0/+38
| | | | llvm-svn: 83012
* Fix a case where ScalarEvolution was expanding pointer arithmeticDan Gohman2009-09-261-0/+41
| | | | | | to inttoptr/ptrtoint unnecessarily. llvm-svn: 82864
* Change tests from "opt %s" to "opt < %s" so that opt doesn't see theDan Gohman2009-09-1178-80/+80
| | | | | | | | 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
* Use "opt < %s" instead of "opt %s" so that opt doesn't print the testDan Gohman2009-09-081-1/+1
| | | | | | filename in the output, which interferes with the tests' grep lines. llvm-svn: 81263
* 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-0843-45/+45
| | | | llvm-svn: 81257
* Change these tests to feed the assembly files to opt directly, insteadDan Gohman2009-09-0882-85/+85
| | | | | | of using llvm-as, now that opt supports this. llvm-svn: 81226
* Eliminate uses of %prcontext.Daniel Dunbar2009-09-051-1/+3
| | | | | | | - I'd appreciate it if someone else eyeballs my changes to make sure I captured the intent of the test. llvm-svn: 81083
* Special-case static allocas in IndVarSimplify's loop invariantDan Gohman2009-08-251-0/+31
| | | | | | | | 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. llvm-svn: 80010
* Generalize ScalarEvolution to be able to analyze GEPs whenDan Gohman2009-08-181-0/+75
| | | | | | | | 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. llvm-svn: 79344
* The upper argument of ConstantRange is exclusive, not inclusive.Dan Gohman2009-07-201-0/+27
| | | | llvm-svn: 76492
* Revert the addition of hasNoPointerOverflow to GEPOperator.Dan Gohman2009-07-201-106/+0
| | | | | | | | | | | | 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. llvm-svn: 76437
* Fill in some holes in ScalarEvolution's loop iteration conditionDan Gohman2009-07-161-0/+38
| | | | | | | analysis. This allows indvars to emit a simpler loop trip count expression. llvm-svn: 76085
* Switch invars away from using isTrapping when it really shouldn't be Eli Friedman2009-07-151-0/+19
| | | | | | using it. llvm-svn: 75852
* Fix the expansion of umax and smax in the case where one or more ofDan Gohman2009-07-141-0/+145
| | | | | | | | the operands have pointer type, so that the resulting type matches the original SCEV type, and so that unnecessary ptrtoints are avoided in common cases. llvm-svn: 75680
* Add a testcase for a bug fixed by r75634.Dan Gohman2009-07-141-0/+36
| | | | llvm-svn: 75644
* Update LoopSimplify and LoopUnswitch to use the new makeLoopInvariantDan Gohman2009-07-141-2/+2
| | | | | | function. llvm-svn: 75584
* Fix indvars to not assume that a loop with a single unique exitDan Gohman2009-07-141-0/+47
| | | | | | block has a single unique exiting block. llvm-svn: 75579
* Reapply 75252, with a fix to avoid the infinite recursion case. TheDan Gohman2009-07-131-1/+0
| | | | | | | check for avoiding re-analyzing a widening cast needed to happen earlier, as getSCEV itself may result in a isLoopGuardedByCond query. llvm-svn: 75511
* Revert r75252 which was causing some crashes at compile time.Nick Lewycky2009-07-111-0/+1
| | | | llvm-svn: 75384
* Generalize ScalarEvolution's cast-folding code to support more kindsDan Gohman2009-07-101-0/+143
| | | | | | | of loops. Add several new functions to for working with ScalarEvolution's add-hoc value-range analysis functionality. llvm-svn: 75252
* Don't cache PHI exit values from exhaustive evaluations, becauseDan Gohman2009-06-291-0/+78
| | | | | | | | an individual exhaustive evaluation reflects only the exit value implied by an individual exit, which may differ from the actual exit value of the loop if there are other exits. This fixes PR4477. llvm-svn: 74447
* When a value is used multiple times within a single PHI, instructionsDan Gohman2009-06-271-0/+33
| | | | | | | | inserted to replace that value must dominate all of of the basic blocks associated with the uses of the value in the PHI, not just one of them. llvm-svn: 74376
* Add some testcases for some of the recent ScalarEvolution bug fixes.Dan Gohman2009-06-261-0/+33
| | | | llvm-svn: 74353
* Simplify [su]max(MAX, n) to MAX. This comes up in loop tripcountDan Gohman2009-06-242-3/+66
| | | | | | | | | computations in loops with multiple exits. Adjust the testcase for PR4436 so that the relevant portion isn't optimized away. llvm-svn: 74073
* When inserting code into a loop preheader, insert it before theDan Gohman2009-06-241-0/+61
| | | | | | | | terminator, instead of after the last phi. This fixes a bug exposed by ScalarEvolution analyzing more kinds of loops. This fixes PR4436. llvm-svn: 74072
* Fix ScalarEvolution's backedge-taken count computations to check forDan Gohman2009-06-211-2/+4
| | | | | | | | overflow when computing a integer division to round up. Thanks to Nick Lewycky for noticing this! llvm-svn: 73862
OpenPOWER on IntegriCloud