[llvm] [EarlyIfConversion] Limit critical-path growth for strongly biased branches (PR #228709)
Dávid Bolvanský via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 4 02:24:26 PDT 2026
davidbolvansky wrote:
I don’t have results from other workloads yet. I found this while investigating why zstd was slower with Clang than GCC on Apple M CPUs. Even after adding an unlikely hint, the branch was still if-converted, adding selects to a loop-carried dependency.
I agree that branch probability is not the misprediction rate. Would it make more sense to use the existing getPredictableBranchThreshold() and avoid critical-path growth for highly biased branches, instead of scaling the budget by the cold-edge probability? SelectOptimize already uses that threshold for its predictability heuristic.
I’m happy to try a different approach. The main thing I wanted to address is the extra dependency introduced by if-converting this cold path.
https://github.com/llvm/llvm-project/pull/228709
More information about the llvm-commits
mailing list