[llvm] [CodeGen] Fix profiled triangular CFG threshold in MachineBlockPlacement (PR #188752)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 6 11:56:39 PDT 2026


worthlane wrote:

> > My concern with capping to `BranchProbability(100,100)` is that all `ProfileLikelyProb` values above 75 would map to the same result, the piecewise mapping was meant to preserve ordering across the full [0,100] range. But if that is not important here, I can simplify it.
> 
> That is fine. It basically says suppressing selecting succ as layout successor when user specifies strong branch bias.
> 
> The problem with the original proposed fix is that it changes the semantics of the algorithm when ProfileLikelyProb > 50 (which is almost always expected -- we don't expect user to specify the option to be lower than 50). This may have significant impact on layout decisions.

That makes sense, I'll simplify it to the capped form. Thanks!

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


More information about the llvm-commits mailing list