Implement "superhero" strength reduction, or full strength

reduction of address calculations down to basic pointer arithmetic.
This is currently off by default, as it needs a few other features
before it becomes generally useful. And even when enabled, full
strength reduction is only performed when it doesn't increase
register pressure, and when several other conditions are true.

This also factors out a bunch of exisiting LSR code out of
StrengthReduceStridedIVUsers into separate functions, and tidies
up IV insertion. This actually decreases register pressure even
in non-superhero mode. The change in iv-users-in-other-loops.ll
is an example of this; there are two more adds because there are
two fewer leas, and there is less spilling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65108 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2009-02-20 04:17:46 +00:00
parent 4ed0c5fb07
commit c17e0cf6c0
4 changed files with 379 additions and 109 deletions
@@ -1,5 +1,5 @@
; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | \
; RUN: grep {add i32 %iv.*inc, 1}
; RUN: grep {add i32 %lsr.iv.next, 1}
;
; Make sure that the use of the IV outside of the loop (the store) uses the
; post incremented value of the IV, not the preincremented value. This