[llvm] [VPlan] Handle live-in extend operands in partial reduction ::computeCost (PR #163175)

Sam Tebbs via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 4 08:07:22 PST 2025


================
@@ -355,10 +357,10 @@ VPPartialReductionRecipe::computeCost(ElementCount VF,
     ExtAType = GetExtendKind(OpR);
   } else if (isa<VPReductionPHIRecipe>(OpR)) {
     auto RedPhiOp1R = getOperand(1)->getDefiningRecipe();
-    if (isa<VPWidenCastRecipe>(RedPhiOp1R)) {
+    if (isa_and_nonnull<VPWidenCastRecipe>(RedPhiOp1R)) {
       InputTypeA = Ctx.Types.inferScalarType(RedPhiOp1R->getOperand(0));
       ExtAType = GetExtendKind(RedPhiOp1R);
-    } else if (auto Widen = dyn_cast<VPWidenRecipe>(RedPhiOp1R))
+    } else if (auto Widen = dyn_cast_if_present<VPWidenRecipe>(RedPhiOp1R))
       HandleWiden(Widen);
   } else if (auto Widen = dyn_cast<VPWidenRecipe>(OpR)) {
----------------
SamTebbs33 wrote:

Sorry for my delay with this. I think you can ignore my request now since the issues weren't relevant with the merged version of my partial reduction bundling patch :)

https://github.com/llvm/llvm-project/pull/163175


More information about the llvm-commits mailing list