[LV] Turn check for unexpected VF into assertion (NFC).

VF should always be non-zero in widenIntOrFpInduction. Turn check into
assertion.
This commit is contained in:
Florian Hahn 2021-12-31 13:19:03 +00:00
parent 2edcde00cb
commit e2f1c4c706
No known key found for this signature in database
GPG Key ID: EEF712BB5E80EBBA
1 changed files with 2 additions and 1 deletions

View File

@ -2499,6 +2499,7 @@ void InnerLoopVectorizer::widenIntOrFpInduction(PHINode *IV,
assert((IV->getType()->isIntegerTy() || IV != OldInduction) &&
"Primary induction variable must have an integer type");
assert(IV->getType() == ID.getStartValue()->getType() && "Types must match");
assert(!State.VF.isZero() && "VF must be non-zero");
// The value from the original loop to which we are mapping the new induction
// variable.
@ -2573,7 +2574,7 @@ void InnerLoopVectorizer::widenIntOrFpInduction(PHINode *IV,
// Now do the actual transformations, and start with creating the step value.
Value *Step = CreateStepValue(ID.getStep());
if (State.VF.isZero() || State.VF.isScalar()) {
if (State.VF.isScalar()) {
Value *ScalarIV = CreateScalarIV(Step);
CreateSplatIV(ScalarIV, Step);
return;