summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Non-affine post-inc SCEV expansions have more code which must beDan Gohman2010-03-021-2/+6
| | | | | | | emitted after the increment. Make sure the insert position reflects this. This fixes PR6453. llvm-svn: 97537
* Spelling fixes.Dan Gohman2010-03-011-11/+11
| | | | llvm-svn: 97453
* Remove unused variables and parameters.Dan Gohman2010-02-221-35/+19
| | | | llvm-svn: 96780
* When emitting an instruction which depends on both a post-incrementedDan Gohman2010-02-221-2/+4
| | | | | | | | | induction variable value and a loop-variant value, don't force the insert position to be at the post-increment position, because it may not be dominated by the loop-variant value. This fixes a use-before-def problem noticed on PPC. llvm-svn: 96774
* Rename getSDiv to getExactSDiv to reflect its behavior in cases whereDan Gohman2010-02-191-23/+25
| | | | | | the division would have a remainder. llvm-svn: 96693
* Check for overflow when scaling up an add or an addrec forDan Gohman2010-02-191-18/+49
| | | | | | scaled reuse. llvm-svn: 96692
* When determining the set of interesting reuse factors, considerDan Gohman2010-02-191-9/+15
| | | | | | | | strides in foreign loops. This helps locate reuse opportunities with existing induction variables in foreign loops and reduces the need for inserting new ones. This fixes rdar://7657764. llvm-svn: 96629
* Delete some unneeded casts.Dan Gohman2010-02-171-2/+2
| | | | llvm-svn: 96429
* Don't attempt to divide INT_MIN by -1; consider such cases toDan Gohman2010-02-171-0/+4
| | | | | | have overflowed. llvm-svn: 96428
* Refactor rewriting for PHI nodes into a separate function.Dan Gohman2010-02-161-49/+70
| | | | llvm-svn: 96382
* Fix whitespace.Dan Gohman2010-02-161-3/+3
| | | | llvm-svn: 96372
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-161-1/+1
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* Split the main for-each-use loop again, this time for GenerateTruncates,Dan Gohman2010-02-161-1/+4
| | | | | | | as it also peeks at which registers are being used by other uses. This makes LSR less sensitive to use-list order. llvm-svn: 96308
* Fix whitespace.Dan Gohman2010-02-141-1/+1
| | | | llvm-svn: 96179
* Fix a comment.Dan Gohman2010-02-141-1/+1
| | | | llvm-svn: 96178
* When complicated expressions are broken down into subexpressionsDan Gohman2010-02-141-2/+8
| | | | | | | | | | with multiplication by constants distributed through, occasionally those subexpressions can include both x and -x. For now, if this condition is discovered within LSR, just prune such cases away, as they won't be profitable. This fixes a "zero allocated in a base register" assertion failure. llvm-svn: 96177
* Actually, this code doesn't have to be quite so conservative inDan Gohman2010-02-141-6/+5
| | | | | | | the no-TLI case. But it should still default to declining the transformation. llvm-svn: 96152
* Don't attempt aggressive post-inc uses if TargetLowering is not available,Dan Gohman2010-02-141-3/+8
| | | | | | because profitability can't be sufficiently approximated. llvm-svn: 96148
* Make LSR not crash if invoked without target lowering info, e.g. if invokedJohn McCall2010-02-131-2/+2
| | | | | | from opt. llvm-svn: 96135
* Fix a pruning heuristic which implicitly assumed that SmallPtrSet isDan Gohman2010-02-131-45/+68
| | | | | | deterministically sorted. llvm-svn: 96071
* Reapply 95979, a compile-time speedup, now that the bug it exposed is fixed.Dan Gohman2010-02-121-1/+1
| | | | llvm-svn: 96005
* Fix this code to avoid dereferencing an end() iterator inDan Gohman2010-02-121-1/+5
| | | | | | offset distributions it doesn't expect. llvm-svn: 96002
* Revert "Reverse the order for collecting the parts of an addrec. The order", itDaniel Dunbar2010-02-121-1/+1
| | | | | | is breaking llvm-gcc bootstrap. llvm-svn: 95988
* Reverse the order for collecting the parts of an addrec. The orderDan Gohman2010-02-121-1/+1
| | | | | | | doesn't matter, except that ScalarEvolution tends to need less time to fold the results this way. llvm-svn: 95979
* Reapply the new LoopStrengthReduction code, with compile time andDan Gohman2010-02-121-2277/+2730
| | | | | | | | | | 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
* Generic reformatting and comment fixing. No functionality change.Bill Wendling2010-01-291-19/+20
| | | | llvm-svn: 94771
* Add newline to debugging output, and fix some grammar-os in comment.Bill Wendling2010-01-291-5/+5
| | | | llvm-svn: 94765
* Revert LoopStrengthReduce.cpp to pre-r94061 for now.Dan Gohman2010-01-221-2355/+2268
| | | | llvm-svn: 94123
* When inserting expressions for post-increment users which containDan Gohman2010-01-211-17/+32
| | | | | | | | loop-variant components, adds must be inserted after the increment. Keep track of the increment position for this case, and insert these adds in the correct location. llvm-svn: 94110
* Include IVUsers information in LSR's debug output.Dan Gohman2010-01-211-1/+1
| | | | llvm-svn: 94108
* Prune the search for candidate formulae if the number of registerDan Gohman2010-01-211-32/+67
| | | | | | | operands exceeds the number of registers used in the initial solution, as that wouldn't lead to a profitable solution anyway. llvm-svn: 94107
* Add a comment.Dan Gohman2010-01-211-1/+2
| | | | llvm-svn: 94104
* Re-implement the main strength-reduction portion of LoopStrengthReduction.Dan Gohman2010-01-211-2269/+2305
| | | | | | | | | | | | | | 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
* Set Changed properly after calling DeleteDeadPHIs.Dan Gohman2010-01-051-1/+1
| | | | llvm-svn: 92735
* Remove dump routine and the associated Debug.h from a header. Patch upDavid Greene2009-12-231-36/+36
| | | | | | other files to compensate. llvm-svn: 92075
* Add Loop contains utility methods for testing whether a loopDan Gohman2009-12-181-13/+13
| | | | | | | | 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
* Minor code simplification.Dan Gohman2009-12-181-4/+1
| | | | llvm-svn: 91653
* Don't pass const pointers by reference.Dan Gohman2009-12-181-13/+13
| | | | llvm-svn: 91647
* Reapply LoopStrengthReduce and IVUsers cleanups, excluding the partDan Gohman2009-12-181-70/+30
| | | | | | | | 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-30/+70
| | | | | | introduced a non-deterministic behavior in the optimizer somewhere. llvm-svn: 91598
* Delete an unused function.Dan Gohman2009-12-151-38/+0
| | | | llvm-svn: 91432
* 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
* Remove unnecessary #includes.Dan Gohman2009-12-141-2/+0
| | | | llvm-svn: 91293
* Instead of having a ScalarEvolution pointer member in BasedUser, just passDan Gohman2009-12-141-12/+13
| | | | | | the ScalarEvolution pointer into the functions which need it. llvm-svn: 91289
* Don't bother cleaning up if there's nothing to clean up.Dan Gohman2009-12-141-6/+6
| | | | llvm-svn: 91288
* Delete an unused variable.Dan Gohman2009-12-141-10/+1
| | | | llvm-svn: 91287
* LSR itself doesn't need LoopInfo.Dan Gohman2009-12-141-6/+2
| | | | llvm-svn: 91283
* LSR itself doesn't need DominatorTree.Dan Gohman2009-12-141-6/+2
| | | | llvm-svn: 91282
* Remove the code in LSR that manually hoists expansions out of loops;Dan Gohman2009-12-141-29/+9
| | | | | | SCEVExpander does this automatically. llvm-svn: 91281
* Minor code cleanups.Dan Gohman2009-12-141-4/+2
| | | | llvm-svn: 91280
OpenPOWER on IntegriCloud