Implement "superhero" strength reduction, or full strength
authorDan Gohman <gohman@apple.com>
Fri, 20 Feb 2009 04:17:46 +0000 (04:17 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 20 Feb 2009 04:17:46 +0000 (04:17 +0000)
commitc17e0cf6c03a36f424fafe88497b5fdf351cd50a
tree96b006e655ecd13cc33279849534ec54753e2932
parent4ed0c5fb07a2a4db3dd1e6a266ba961429aba2ec
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
lib/Transforms/Scalar/LoopStrengthReduce.cpp
test/CodeGen/X86/full-lsr.ll [new file with mode: 0644]
test/CodeGen/X86/iv-users-in-other-loops.ll
test/Transforms/LoopStrengthReduce/use_postinc_value_outside_loop.ll