[disable-iv-rewrite] Allow WidenIV to handle NSW/NUW operations
authorAndrew Trick <atrick@apple.com>
Sat, 10 Sep 2011 01:24:17 +0000 (01:24 +0000)
committerAndrew Trick <atrick@apple.com>
Sat, 10 Sep 2011 01:24:17 +0000 (01:24 +0000)
commit20151da8c38287b9fa181e9fef93f70bc2cd9fd2
tree83d9084415a4760b639928fe3958067ee2c55d3a
parent543376743c900806109c75d4fd12c4ba01020cfe
[disable-iv-rewrite] Allow WidenIV to handle NSW/NUW operations
better.

Don't immediately give up when an add operation can't be trivially
sign/zero-extended within a loop. If it has NSW/NUW flags, generate a
new expression with sign extended (non-recurrent) operand. As before,
if SCEV says that all sign extends are loop invariant, then we can
widen the operation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139453 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/IndVarSimplify.cpp