Skip to content

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);
 }
 

@github-actions
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.

@vitalybuka vitalybuka changed the title [Fuzzer] Adopt createUnlikelyBranchWeights in CreateGateBranch [sancov] Adopt createUnlikelyBranchWeights in CreateGateBranch Nov 24, 2024
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.

3 participants