[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 21 06:10:37 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.
+    // FIXME: Removing the branch happens in simplifyBranchConditionForVFAndUF
----------------
david-arm wrote:

OK no problem. I wasn't sure how easy it would be, but thanks for looking into it! I can follow up with a later PR to get access to the SCEV here.

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


More information about the llvm-commits mailing list