Skip to content

Commit b0b5009

Browse files
committed
Replace the #definition check with isa<>.
1 parent 3b32a4e commit b0b5009

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,15 +1494,15 @@ bool VPlanTransforms::tryAddExplicitVectorLength(VPlan &Plan) {
14941494
}
14951495

14961496
if (NewRecipe) {
1497-
unsigned NumDefVal = NewRecipe->getNumDefinedValues();
1497+
[[maybe_unused]] unsigned NumDefVal = NewRecipe->getNumDefinedValues();
14981498
assert(NumDefVal == CurRecipe->getNumDefinedValues() &&
14991499
"New recipe must define the same number of values as the "
15001500
"original.");
15011501
assert(
15021502
NumDefVal <= 1 &&
15031503
"Only supports recipes with a single definition or without users.");
15041504
NewRecipe->insertBefore(CurRecipe);
1505-
if (NumDefVal > 0) {
1505+
if (isa<VPSingleDefRecipe, VPWidenLoadEVLRecipe>(NewRecipe)) {
15061506
VPValue *CurVPV = CurRecipe->getVPSingleValue();
15071507
CurVPV->replaceAllUsesWith(NewRecipe->getVPSingleValue());
15081508
}

0 commit comments

Comments
 (0)