Teach LSR to optimize more loop exit compares, i.e. change them to use postinc iv...
authorEvan Cheng <evan.cheng@apple.com>
Mon, 11 May 2009 22:33:01 +0000 (22:33 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Mon, 11 May 2009 22:33:01 +0000 (22:33 +0000)
commit5792f51e12d9c8685399e9857799365854ab5bf6
tree70eb5ebee02553ba2b892ce1ff7f7bbaad77a682
parent6dc4ade59505fd8a01370ff8da5b18110f7a2f41
Teach LSR to optimize more loop exit compares, i.e. change them to use postinc iv value. Previously LSR would only optimize those which are in the loop latch block. However, if LSR can prove it is safe (and profitable), it's now possible to change those not in the latch blocks to use postinc values.

Also, if the compare is the only use, LSR would place the iv increment instruction before the compare instead in the latch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71485 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LoopStrengthReduce.cpp
test/CodeGen/X86/lsr-loop-exit-cond.ll [new file with mode: 0644]
test/CodeGen/X86/lsr-negative-stride.ll
test/CodeGen/X86/remat-mov-1.ll [new file with mode: 0644]
test/CodeGen/X86/remat-mov0.ll [deleted file]