[llvm] [Fuzzer] Adopt createUnlikelyBranchWeights in CreateGateBranch (PR #117398)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 22 15:08:59 PST 2024
https://github.com/thetruestblue created https://github.com/llvm/llvm-project/pull/117398
Adopt the extracted branch weights method added here: https://github.com/llvm/llvm-project/commit/c60aa430dc4085d276a630699323068bf36bd9d8
>From 962bd8cff472f78ae51a493a2eaa3e41cc44b92b Mon Sep 17 00:00:00 2001
From: thetruestblue <92476612+thetruestblue at users.noreply.github.com>
Date: Fri, 22 Nov 2024 15:04:26 -0800
Subject: [PATCH] [Fuzzer] Adopt createUnlikelyBranchWeights in
CreateGateBranch
Adopt the extracted branch weights method added here: #89464
---
llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
index 139e75dd3ddb34..ae97c6fc86dae9 100644
--- a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
+++ b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
@@ -831,7 +831,7 @@ Instruction *ModuleSanitizerCoverage::CreateGateBranch(Function &F,
// Set the branch weights in order to minimize the price paid when the
// gate is turned off, allowing the default enablement of this
// instrumentation with as little of a performance cost as possible
- auto Weights = MDBuilder(*C).createBranchWeights(1, 100000);
+ auto Weights = MDBuilder(*C).createUnlikelyBranchWeights();
return SplitBlockAndInsertIfThen(FunctionGateCmp, IP, false, Weights);
}
More information about the llvm-commits
mailing list