[llvm] [VPlan] Give zero-weight edges minimum probability. (PR #226150)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 01:57:48 PDT 2026


================
@@ -1222,6 +1222,10 @@ getSuccessorProbabilities(const VPBasicBlock *VPBB) {
     auto [Succ, Weight] = SuccWeight;
     if (Total == 0)
       return std::make_pair(Succ, BranchProbability::getUnknown());
+    // Like BlockFrequencyInfo, treat zero branch weights cold, not as never
+    // taken.
+    if (Weight == 0)
+      return std::make_pair(Succ, BranchProbability::getRaw(1));
----------------
fhahn wrote:

It looks like there are a few more gaps, I want ahead and restructured the code to try to re-use more of BFI's logic: https://github.com/llvm/llvm-project/pull/226841

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


More information about the llvm-commits mailing list