[IndVarSimplify] Lift limitations on IV being a Phi for turn-to-invariant
authorMax Kazantsev <mkazantsev@azul.com>
Tue, 22 Nov 2022 05:53:37 +0000 (12:53 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Tue, 22 Nov 2022 05:53:37 +0000 (12:53 +0700)
commit57fd7ffefffae313de800fecdd9f095a17bfd4ea
treea45936594810dd900b3cf1e2c8d61cb7713d7f78
parent3a95d7d0983af26811e72d238d94f11c25f1851a
[IndVarSimplify] Lift limitations on IV being a Phi for turn-to-invariant

These limitations are too strict, and their only purpose is to avoid code
size explosion. These restrictions seem obsolete, and the size problem
is solved in other places through cheap expansion limits.

The motivation is that the old code cannot deal with comparisons against
induction variant's increment.

Differential Revision: https://reviews.llvm.org/D138412
Reviewed By: lebedev.ri, reames
llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
llvm/test/Transforms/IndVarSimplify/X86/loop-invariant-conditions.ll
llvm/test/Transforms/IndVarSimplify/X86/pr57187.ll