indvars: insert truncate at loop boundary to avoid redundant IVs.
authorAndrew Trick <atrick@apple.com>
Thu, 2 Jan 2014 19:29:38 +0000 (19:29 +0000)
committerAndrew Trick <atrick@apple.com>
Thu, 2 Jan 2014 19:29:38 +0000 (19:29 +0000)
commitfcbe3d950148f01ed8ed47afda78a13f81a8010b
treef1518cc3948d6712f7b3291e8dac61c74714c3e4
parentd573aba8e13c2afc5ad7c3c3c442a3a84f8bd94d
indvars: insert truncate at loop boundary to avoid redundant IVs.

When widening an IV to remove s/zext, we generally try to eliminate
the original narrow IV. However, LCSSA phi nodes outside the loop were
still using the original IV. Clean this up more aggressively to avoid
redundancy in generated code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198338 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/IndVarSimplify.cpp
test/Transforms/IndVarSimplify/iv-widen.ll [new file with mode: 0644]