[IndVars] Preserve LCSSA in `eliminateIdentitySCEV`
authorSanjoy Das <sanjoy@playingwithpointers.com>
Wed, 7 Oct 2015 17:38:31 +0000 (17:38 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Wed, 7 Oct 2015 17:38:31 +0000 (17:38 +0000)
commitd23e55c402180a9599a529263d89f9fff824ce2e
treeb0adaea3b500da7fe34429f08ee4b5a17f4793c9
parent655d66e1fe299be7143ec41aefb41f77f8bce867
[IndVars] Preserve LCSSA in `eliminateIdentitySCEV`

Summary:
After r249211, SCEV can see through some LCSSA phis.  Add a
`replacementPreservesLCSSAForm` check before replacing uses of these phi
nodes with a simplified use of the induction variable to avoid breaking
LCSSA.

Fixes 25047.

Depends on D13460.

Reviewers: atrick, hfinkel

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D13461

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