Revert "Revert "[IndVars] Replace PHIs if loop exits on 1st iteration""
authorMax Kazantsev <mkazantsev@azul.com>
Mon, 20 Sep 2021 04:28:56 +0000 (11:28 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Mon, 20 Sep 2021 05:01:10 +0000 (12:01 +0700)
commit471217cff8e5c827f2ee52175a1c94584699cab2
tree9e07ac6d758e695fe8197de5280a1f6148a25d9f
parent74670e79b0a00224c04dfc6a446ea4439f4cfca4
Revert "Revert "[IndVars] Replace PHIs if loop exits on 1st iteration""

This reverts commit 6fec6552f54885ae06bf76b35f9f1173a0561a4c.

The patch was reverted on incorrect claim that this patch may break LCSSA form
when the loop is not in a simplify form. All IndVars' transform insure that
the loop is in simplify and LCSSA form, so if it wasn't broken before this
transform, it will also not be broken after it.
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
llvm/test/Transforms/IndVarSimplify/eliminate-backedge.ll
llvm/test/Transforms/IndVarSimplify/eliminate-exit-no-dl.ll
llvm/test/Transforms/IndVarSimplify/floating-point-iv.ll