Skip to content

Commit 65dd29b

Browse files
committed
[LV] Compare induction start values via SCEV in assertion (NFCI).
Instead of comparing plain VPValue in the assertion checking the start values, directly compare the SCEV's. This future-proofs the code in preparation of performing more simplifications/canonicalizations for live-ins.
1 parent d33d9ac commit 65dd29b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7693,7 +7693,10 @@ createWidenInductionRecipes(VPInstruction *PhiR,
76937693
"step must be loop invariant");
76947694

76957695
VPValue *Start = PhiR->getOperand(0);
7696-
assert(Plan.getLiveIn(IndDesc.getStartValue()) == Start &&
7696+
assert((Plan.getLiveIn(IndDesc.getStartValue()) == Start ||
7697+
(SE.isSCEVable(IndDesc.getStartValue()->getType()) &&
7698+
SE.getSCEV(IndDesc.getStartValue()) ==
7699+
vputils::getSCEVExprForVPValue(Start, SE))) &&
76977700
"Start VPValue must match IndDesc's start value");
76987701

76997702
// It is always safe to copy over the NoWrap and FastMath flags. In

0 commit comments

Comments
 (0)