summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/IVUsers.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* LSR: fix IVUsers isSimplifiedLoopNest to perform a full domtree walkAndrew Trick2012-03-201-19/+23
| | | | | | | | | 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-5/+41
| | | | | | | | | | | | | | 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
* Put all IVUsers in the processed set. Allow querying IVUsers with ↵Andrew Trick2012-01-061-3/+6
| | | | | | isIVUserOrOperand. llvm-svn: 147686
* Slightly more useful tracing.Andrew Trick2011-10-131-1/+2
| | | | llvm-svn: 141867
* Teach IVUsers to stop at non-affine expressions unless they are bothDan Gohman2011-07-011-7/+10
| | | | | | | | | | | | | | | | | outside the loop and reducible. This more completely hides them from LSR, which isn't usually able to do anything meaningful with non-affine expressions anyway, and this consequently hides them from SCEVExpander, which is acutely unprepared for non-affine expressions. Replace test/CodeGen/X86/lsr-nonaffine.ll with a new test that tests the new behavior. This works around the bug in PR10117 / rdar://problem/9633149, and is generally an improvement besides. llvm-svn: 134268
* indvars --disable-iv-rewrite: sever ties with IVUsers.Andrew Trick2011-06-281-15/+0
| | | | llvm-svn: 133988
* IVUsers no longer needs to record the phis.Andrew Trick2011-06-211-8/+7
| | | | llvm-svn: 133518
* Update this comment.Dan Gohman2011-05-271-1/+3
| | | | llvm-svn: 132202
* indvars: Prototyping Sign/ZeroExtend elimination without canonical IVs.Andrew Trick2011-05-201-7/+7
| | | | | | | | | | No functionality enabled by default. Use -disable-iv-rewrite. Extended IVUsers to keep track of the phi that represents the users' IV. Added the WidenIV transform to replace a narrow IV with a wide IV by doing a one-for-one replacement of IV users instead of expanding the SCEV expressions. [sz]exts are removed and truncs are inserted. llvm-svn: 131744
* indvars: Added DisableIVRewrite and WidenIVs.Andrew Trick2011-05-041-0/+15
| | | | | | | | This adds functionality to remove size/zero extension during indvars without generating a canonical IV and rewriting all IV users. It's disabled by default so should have no effect on codegen. Work in progress. llvm-svn: 130829
* Avoid creating canonical induction variables for non-native types.Andrew Trick2011-03-181-1/+6
| | | | | | | | 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
* split dom frontier handling stuff out to its own DominanceFrontier header,Chris Lattner2011-01-021-0/+1
| | | | | | so that Dominators.h is *just* domtree. Also prune #includes a bit. llvm-svn: 122714
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-191-1/+2
| | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. llvm-svn: 116820
* 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
OpenPOWER on IntegriCloud