Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fuzzer] Adopt createUnlikelyBranchWeights in CreateGateBranch #117398

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thetruestblue
Copy link
Contributor

Adopt the extracted branch weights method added here: c60aa43

Adopt the extracted branch weights method added here: llvm#89464
@llvmbot
Copy link
Member

llvmbot commented Nov 22, 2024

@llvm/pr-subscribers-llvm-transforms

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: None (thetruestblue)

Changes

Adopt the extracted branch weights method added here: c60aa43


Full diff: https://github.com/llvm/llvm-project/pull/117398.diff

1 Files Affected:

  • (modified) llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp (+1-1)
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);
 }
 

Copy link

⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.
Please turn off Keep my email addresses private setting in your account.
See LLVM Discourse for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants