[llvm] [VPlan] Don't apply predication discount to non-originally-predicated blocks (PR #160449)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 1 05:39:52 PDT 2025


================
@@ -855,7 +855,9 @@ InstructionCost VPRegionBlock::cost(ElementCount VF, VPCostContext &Ctx) {
   // For the scalar case, we may not always execute the original predicated
   // block, Thus, scale the block's cost by the probability of executing it.
   if (VF.isScalar())
-    return ThenCost / getPredBlockCostDivisor(Ctx.CostKind);
+    if (auto *VPIRBB = dyn_cast<VPIRBasicBlock>(Then))
----------------
lukel97 wrote:

Oh thanks for pointing that out, I didn't even notice it was dead. Should be rebased now.

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


More information about the llvm-commits mailing list