[llvm] [LoopUnroll] Relax fixed non-latch exit probability threshold for runtime multi-exit loop unrolling (PR #224325)
Marek Sedláček via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 29 10:54:13 PDT 2026
================
@@ -585,6 +590,14 @@ static bool canProfitablyRuntimeUnrollMultiExitLoop(
// If BranchProbability could not be extracted (returns unknown), then
// don't return and do the check for deopt block.
if (!BranchProb.isUnknown()) {
+ // Special case for linear scan loop with trip count < ~100, which will
+ // not pass the P < 1/100 check bellow.
----------------
mark-sed wrote:
> why don't we replace the old heuristic with this one? Or, in other words, what's the motivation for keeping the old one around?
That is a good point... I suppose it was just my conservative approach where I wanted to allow for the old threshold if MinBodies is 0, but now that you raised this, I suppose it should be rather removed. I will update that tomorrow, thanks.
https://github.com/llvm/llvm-project/pull/224325
More information about the llvm-commits
mailing list