summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/IVUsers.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Begin adding static dependence information to passes, which will allow us toOwen Anderson2010-10-121-1/+7
| | | | | | | | | perform initialization without static constructors AND without explicit initialization by the client. For the moment, passes are required to initialize both their (potential) dependencies and any passes they preserve. I hope to be able to relax the latter requirement in the future. llvm-svn: 116334
* Now with fewer extraneous semicolons!Owen Anderson2010-10-071-1/+1
| | | | llvm-svn: 115996
* stop forcing a noop AssemblyAnnotationWriter to silence #usesChris Lattner2010-09-021-5/+1
| | | | | | comments, these don't happen anymore. llvm-svn: 112901
* Revert 112442 and 112440 until the compile time problems introducedDan Gohman2010-09-011-89/+78
| | | | | | by 112440 are resolved. llvm-svn: 112692
* Make IVUsers iterative instead of recursive.Dan Gohman2010-08-291-78/+89
| | | | | | | This has the side effect of reversing the order of most of IVUser's results. llvm-svn: 112442
* Tweak IVUsers' concept of "interesting" to exclude add recurrencesDan Gohman2010-08-171-12/+16
| | | | | | | | | where the step value is an induction variable from an outer loop, to avoid trouble trying to re-expand such expressions. This effectively hides such expressions from indvars and lsr, which prevents them from getting into trouble. llvm-svn: 111317
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110460
* Revert r110396 to fix buildbots.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110410
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-051-1/+1
| | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. llvm-svn: 110396
* Fix batch of converting RegisterPass<> to INTIALIZE_PASS().Owen Anderson2010-07-211-2/+1
| | | | llvm-svn: 109045
* Remove the Expr member from IVUsers. Instead of remembering the expression,Dan Gohman2010-04-191-29/+27
| | | | | | | just ask ScalarEvolution for it on demand. This helps IVUsers be more robust in the case of expressions changing underneath it. This fixes PR6862. llvm-svn: 101819
* Add a cast to void to show that the return value is beingDan Gohman2010-04-111-1/+1
| | | | | | intentionally ignored. llvm-svn: 100984
* Delete a dead check.Dan Gohman2010-04-111-1/+0
| | | | llvm-svn: 100983
* Delete dead code.Dan Gohman2010-04-111-26/+0
| | | | llvm-svn: 100981
* Fix a bug in IVUsers which was permitting non-affine addrecs toDan Gohman2010-04-091-2/+2
| | | | | | be sent to LSR, which it isn't prepared to handle. llvm-svn: 100839
* Generalize IVUsers to track arbitrary expressions rather than expressionsDan Gohman2010-04-071-160/+82
| | | | | | | | | | | | | | | 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
* Add a const qualifier.Dan Gohman2010-04-061-1/+1
| | | | llvm-svn: 100515
* Spelling fixes.Dan Gohman2010-03-011-2/+2
| | | | llvm-svn: 97453
* Remove unused variables and parameters.Dan Gohman2010-02-221-3/+2
| | | | llvm-svn: 96780
* Simplify this code; no need for a custom subclass if it doesn't needDan Gohman2010-02-141-8/+3
| | | | | | to override anything from the parent class. llvm-svn: 96150
* Reapply the new LoopStrengthReduction code, with compile time andDan Gohman2010-02-121-123/+72
| | | | | | | | | | 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
* Use an AssemblyAnnotatorWriter to clean up IVUsers' debug output.Dan Gohman2010-02-101-1/+10
| | | | | | The "uses=" comments are just clutter in this context. llvm-svn: 95799
* Add "dump" method to IVUsersOneStride.Bill Wendling2010-02-011-0/+23
| | | | llvm-svn: 95022
* Re-implement the main strength-reduction portion of LoopStrengthReduction.Dan Gohman2010-01-211-6/+0
| | | | | | | | | | | | | | 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 a new helper function to IVUsers for returning the "canonical"Dan Gohman2010-01-191-0/+13
| | | | | | | | form of an expression. This is the expression without the post-increment adjustment made, which is useful in determining which registers will be used by the expansion. llvm-svn: 93921
* Use WriteAsOperand instead of getName() to print loop header names,Dan Gohman2010-01-091-2/+3
| | | | | | so that unnamed blocks are handled. llvm-svn: 93059
* Convert debug messages to use dbgs(). Generally this meansDavid Greene2009-12-231-5/+5
| | | | | | s/errs/dbgs/g except for certain special cases. llvm-svn: 92037
* Add Loop contains utility methods for testing whether a loopDan Gohman2009-12-181-4/+4
| | | | | | | | contains another loop, or an instruction. The loop form is substantially more efficient on large loops than the typical code it replaces. llvm-svn: 91654
* Reapply LoopStrengthReduce and IVUsers cleanups, excluding the partDan Gohman2009-12-181-1/+2
| | | | | | | | of 91296 that caused trouble -- the Processed list needs to be preserved for the livetime of the pass, as AddUsersIfInteresting is called from other passes. llvm-svn: 91641
* Revert 91280-91283, 91286-91289, 91291, 91293, 91295-91296. It apparently ↵Evan Cheng2009-12-171-3/+2
| | | | | | introduced a non-deterministic behavior in the optimizer somewhere. llvm-svn: 91598
* Clear the Processed set when it is no longer used, and clear theDan Gohman2009-12-141-1/+2
| | | | | | IVUses list in releaseMemory(). llvm-svn: 91296
* Fix a thinko; isNotAlreadyContainedIn had a built-in negative, so theDan Gohman2009-12-141-1/+1
| | | | | | condition was inverted when the code was converted to contains(). llvm-svn: 91295
* Drop Loop::isNotAlreadyContainedIn in favor of Loop::contains. TheDan Gohman2009-12-141-1/+1
| | | | | | former was just exposing a LoopInfoBase implementation detail. llvm-svn: 91286
* enable iv-users simplification by defaultJim Grosbach2009-11-231-7/+1
| | | | llvm-svn: 89713
* Teach IVUsers to keep things simpler and track loop-invariant strides onlyJim Grosbach2009-11-191-0/+10
| | | | | | | for uses inside the loop. This works better with LSR. Disabled behind -simplify-iv-users while benchmarking. llvm-svn: 89299
* - Teach LSR to avoid changing cmp iv stride if it will create an immediate thatEvan Cheng2009-11-121-0/+12
| | | | | | | | | | | | | | cannot be folded into target cmp instruction. - Avoid a phase ordering issue where early cmp optimization would prevent the later count-to-zero optimization. - Add missing checks which could cause LSR to reuse stride that does not have users. - Fix a bug in count-to-zero optimization code which failed to find the pre-inc iv's phi node. - Remove, tighten, loosen some incorrect checks disable valid transformations. - Quite a bit of code clean up. llvm-svn: 86969
* Fix IVUsers to avoid assuming that the loop has a unique backedge.Dan Gohman2009-11-051-0/+2
| | | | llvm-svn: 86161
* Instead of testing whether an instruction dominates the loop preheader,Dan Gohman2009-09-271-3/+3
| | | | | | | | | test whether it properly dominates the loop header. This is equivalent when the loop has a preheader, and has the advantage of working when the loop doesn't have a preheader. Since IVUsers doesn't Require LoopSimplify, the loop isn't guaranteed to have a preheader. llvm-svn: 82899
* Remove a redundant #include.Dan Gohman2009-09-271-1/+0
| | | | llvm-svn: 82897
* remove a few dead insertion methods.Chris Lattner2009-08-241-5/+0
| | | | llvm-svn: 79882
* remove a few DOUTs here and there.Chris Lattner2009-08-231-1/+1
| | | | llvm-svn: 79832
* eliminate the "Value" printing methods that print to a std::ostream.Chris Lattner2009-08-231-4/+4
| | | | | | This required converting a bunch of stuff off DOUT and other cleanups. llvm-svn: 79819
* Fix more missing newlines.Dan Gohman2009-08-171-2/+2
| | | | llvm-svn: 79244
* More migration to raw_ostream, the water has dried up around the iostream hole.Daniel Dunbar2009-07-251-2/+2
| | | | | | | | | | - Some clients which used DOUT have moved to DEBUG. We are deprecating the "magic" DOUT behavior which avoided calling printing functions when the statement was disabled. In addition to being unnecessary magic, it had the downside of leaving code in -Asserts builds, and of hiding potentially unnecessary computations. llvm-svn: 77019
* Add a newline, now that Value's operator<< doesn't print one.Dan Gohman2009-07-141-0/+1
| | | | llvm-svn: 75568
* Make Loop and MachineLoop be subclasses of LoopBase, rather than typedefs,Dan Gohman2009-07-131-1/+1
| | | | | | | | | | using the Curiously Recurring Template Pattern with LoopBase. This will help further refactoring, and future functionality for Loop. Also, Headers can now foward-declare Loop, instead of pulling in LoopInfo.h or doing tricks. llvm-svn: 75519
* Change all SCEV* to SCEV *.Dan Gohman2009-07-071-14/+14
| | | | llvm-svn: 74918
* SCEVHandle is no more!Owen Anderson2009-06-221-14/+14
| | | | llvm-svn: 73906
* Don't (unconditionally) use getSCEVAtScope to simplify the stepDan Gohman2009-06-191-1/+0
| | | | | | | | 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
* Remove the code from IVUsers that attempted to handleDan Gohman2009-06-181-27/+3
| | | | | | | | | | | casted induction variables in cases where the cast isn't foldable. It ended up being a pessimization in many cases. This could be fixed, but it would require a bunch of complicated code in IVUsers' clients. The advantages of this approach aren't visible enough to justify it at this time. llvm-svn: 73706
OpenPOWER on IntegriCloud