Strength reduction improvements.
authorDan Gohman <gohman@apple.com>
Mon, 22 Oct 2007 20:40:42 +0000 (20:40 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 22 Oct 2007 20:40:42 +0000 (20:40 +0000)
commit02e4fa7d5fb4edd2ce9c7ede29c74d50cb126d7d
treedd1a099ed5fe939eef704a76816872cdf6323a71
parent8368805e255d53a68f89e341b69ed0f7022509c4
Strength reduction improvements.

 - Avoid attempting stride-reuse in the case that there are users that
   aren't addresses. In that case, there will be places where the
   multiplications won't be folded away, so it's better to try to
   strength-reduce them.

 - Several SSE intrinsics have operands that strength-reduction can
   treat as addresses. The previous item makes this more visible, as
   any non-address use of an IV can inhibit stride-reuse.

 - Make ValidStride aware of whether there's likely to be a base
   register in the address computation. This prevents it from thinking
   that things like stride 9 are valid on x86 when the base register is
   already occupied.

Also, XFAIL the 2007-08-10-LEA16Use32.ll test; the new logic to avoid
stride-reuse elimintes the LEA in the loop, so the test is no longer
testing what it was intended to test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43231 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LoopStrengthReduce.cpp
test/CodeGen/X86/2007-08-10-LEA16Use32.ll
test/CodeGen/X86/stride-nine-with-base-reg.ll [new file with mode: 0644]
test/CodeGen/X86/stride-reuse.ll [new file with mode: 0644]