[llvm] [MachineSink] Lower SplitEdgeProbabilityThreshold (PR #127666)
Guy David via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 18 08:48:28 PST 2025
https://github.com/guy-david created https://github.com/llvm/llvm-project/pull/127666
Lower it slightly below the likeliness of a null-check to be true which is set to 37.5% (see PtrUntakenProb).
Otherwise, it will split the edge and create another basic-block and with an unconditional branch which might make the CFG more complex and with a suboptimal block placement.
Note that if multiple instructions can be sinked from the same edge then a split will occur regardless of this change.
How should I go around testing for performance regressions? Although unlikely IMO.
>From b20f2dc6ce822e3345415caacba82c3c8ca416c7 Mon Sep 17 00:00:00 2001
From: Guy David <guyda96 at gmail.com>
Date: Mon, 17 Feb 2025 17:26:32 +0200
Subject: [PATCH] [MachineSink] Lower SplitEdgeProbabilityThreshold
Lower it slightly below the likeliness of a null-check to be true which
is set to 37.5% (see PtrUntakenProb).
Otherwise, it will split the edge and create another basic-block and
with an unconditional branch which might make the CFG more complex and
with a suboptimal block placement.
Note that if multiple instructions can be sinked from the same edge then
a split will occur regardless of this change.
---
llvm/lib/CodeGen/MachineSink.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/lib/CodeGen/MachineSink.cpp b/llvm/lib/CodeGen/MachineSink.cpp
index 82acb780cfb72..81459cf65d6c2 100644
--- a/llvm/lib/CodeGen/MachineSink.cpp
+++ b/llvm/lib/CodeGen/MachineSink.cpp
@@ -82,7 +82,7 @@ static cl::opt<unsigned> SplitEdgeProbabilityThreshold(
"If the branch threshold is higher than this threshold, we allow "
"speculative execution of up to 1 instruction to avoid branching to "
"splitted critical edge"),
- cl::init(40), cl::Hidden);
+ cl::init(35), cl::Hidden);
static cl::opt<unsigned> SinkLoadInstsPerBlockThreshold(
"machine-sink-load-instrs-threshold",
More information about the llvm-commits
mailing list