[llvm] [VPlan] Give zero-weight edges minimum probability. (PR #226150)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 28 02:08:44 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:
Yes, https://github.com/llvm/llvm-project/pull/226841 should match the round-up step
https://github.com/llvm/llvm-project/pull/226150
More information about the llvm-commits
mailing list