[llvm] [VPlan] Don't use the legacy cost model for loop conditions (PR #156864)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 14 10:33:21 PDT 2025


================
@@ -1151,6 +1151,32 @@ InstructionCost VPInstruction::computeCost(ElementCount VF,
     return Ctx.TTI.getIndexedVectorInstrCostFromEnd(Instruction::ExtractElement,
                                                     VecTy, Ctx.CostKind, 0);
   }
+  case VPInstruction::BranchOnCount: {
+    // If TC <= VF then this is just a branch.
----------------
david-arm wrote:

I'm not sure what this means. Are you saying that we create a vplan for a given VF despite knowing that we will never enter the vector loop? I guess this can happen if TC is exactly equal to VF or we're using tail-folding, but not using the mask for control flow.

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


More information about the llvm-commits mailing list