[PATCH] D143060: [TTI][NFC] Introduce option to set predictable branch threshold
Serguei Katkov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 2 02:55:24 PST 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6188929dfbda: [TTI][NFC] Introduce option to set predictable branch threshold (authored by skatkov).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143060/new/
https://reviews.llvm.org/D143060
Files:
llvm/lib/Analysis/TargetTransformInfo.cpp
Index: llvm/lib/Analysis/TargetTransformInfo.cpp
===================================================================
--- llvm/lib/Analysis/TargetTransformInfo.cpp
+++ llvm/lib/Analysis/TargetTransformInfo.cpp
@@ -37,6 +37,11 @@
cl::desc("Use this to override the target cache line size when "
"specified by the user."));
+static cl::opt<unsigned> PredictableBranchThreshold(
+ "predictable-branch-threshold", cl::init(99), cl::Hidden,
+ cl::desc(
+ "Use this to override the target's predictable branch threshold (%)."));
+
namespace {
/// No-op implementation of the TTI interface using the utility base
/// classes.
@@ -232,7 +237,9 @@
}
BranchProbability TargetTransformInfo::getPredictableBranchThreshold() const {
- return TTIImpl->getPredictableBranchThreshold();
+ return PredictableBranchThreshold.getNumOccurrences() > 0
+ ? BranchProbability(PredictableBranchThreshold, 100)
+ : TTIImpl->getPredictableBranchThreshold();
}
bool TargetTransformInfo::hasBranchDivergence() const {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143060.494229.patch
Type: text/x-patch
Size: 1060 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230202/d5f2242d/attachment.bin>
More information about the llvm-commits
mailing list