[LV] Replace check with assert for reduction resume values (NFC).

At this point, we need to have resume values for all inductions. If not,
this would result in silent mis-compiles.
This commit is contained in:
Florian Hahn 2022-10-08 16:26:08 +01:00
parent be858bda69
commit 73950f26f5
No known key found for this signature in database
GPG Key ID: EEF712BB5E80EBBA
1 changed files with 5 additions and 5 deletions

View File

@ -10498,11 +10498,11 @@ bool LoopVectorizePass::processLoop(Loop *L) {
// updated before vectorising the epilogue loop.
for (VPRecipeBase &R : Header->phis()) {
if (auto *ReductionPhi = dyn_cast<VPReductionPHIRecipe>(&R)) {
if (auto *Resume = MainILV.getReductionResumeValue(
ReductionPhi->getRecurrenceDescriptor())) {
VPValue *StartVal = BestEpiPlan.getOrAddExternalDef(Resume);
ReductionPhi->setOperand(0, StartVal);
}
Value *Resume = MainILV.getReductionResumeValue(
ReductionPhi->getRecurrenceDescriptor());
assert(Resume && "Must have a resume value.");
VPValue *StartVal = BestEpiPlan.getOrAddExternalDef(Resume);
ReductionPhi->setOperand(0, StartVal);
}
}