Skip to content

Commit c7a7773

Browse files
committed
[VPlan] Replace else-if dyn_cast with cast (NFC).
The recipes handled here are either VPWidenIntrinsic or VPWidenCast, so replace the else-if dyn_cast with a single else + cast.
1 parent c2b89fc commit c7a7773

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,12 +1488,14 @@ static VPRecipeBase *createEVLRecipe(VPValue *HeaderMask,
14881488
})
14891489
.Case<VPWidenIntrinsicRecipe, VPWidenCastRecipe>(
14901490
[&](auto *CR) -> VPRecipeBase * {
1491-
Intrinsic::ID VPID = Intrinsic::not_intrinsic;
1492-
if (auto *CallR = dyn_cast<VPWidenIntrinsicRecipe>(CR))
1491+
Intrinsic::ID VPID;
1492+
if (auto *CallR = dyn_cast<VPWidenIntrinsicRecipe>(CR)) {
14931493
VPID =
14941494
VPIntrinsic::getForIntrinsic(CallR->getVectorIntrinsicID());
1495-
else if (auto *CastR = dyn_cast<VPWidenCastRecipe>(CR))
1495+
} else {
1496+
auto *CastR = cast<VPWidenCastRecipe>(CR);
14961497
VPID = VPIntrinsic::getForOpcode(CastR->getOpcode());
1498+
}
14971499
assert(VPID != Intrinsic::not_intrinsic && "Expected VP intrinsic");
14981500
assert(VPIntrinsic::getMaskParamPos(VPID) &&
14991501
VPIntrinsic::getVectorLengthParamPos(VPID) &&

0 commit comments

Comments
 (0)