Skip to content

Commit e18a547

Browse files
committed
[VPlan] Fold if into return in prepareToExecute assertion (NFC).
Independent simplification suggested in D157194.
1 parent 241cceb commit e18a547

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

llvm/lib/Transforms/Vectorize/VPlan.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -758,12 +758,10 @@ void VPlan::prepareToExecute(Value *TripCountV, Value *VectorTripCountV,
758758
auto *IV = getCanonicalIV();
759759
assert(all_of(IV->users(),
760760
[](const VPUser *U) {
761-
if (isa<VPScalarIVStepsRecipe>(U) ||
762-
isa<VPDerivedIVRecipe>(U))
763-
return true;
764-
auto *VPI = cast<VPInstruction>(U);
765-
return VPI->getOpcode() ==
766-
VPInstruction::CanonicalIVIncrement;
761+
return isa<VPScalarIVStepsRecipe>(U) ||
762+
isa<VPDerivedIVRecipe>(U) ||
763+
cast<VPInstruction>(U)->getOpcode() ==
764+
VPInstruction::CanonicalIVIncrement;
767765
}) &&
768766
"the canonical IV should only be used by its increment or "
769767
"ScalarIVSteps when resetting the start value");

0 commit comments

Comments
 (0)