[llvm] [BOLT] skip the warm cold check option (PR #95322)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 15:32:54 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-bolt

Author: Daniel Hill (hilldani)

<details>
<summary>Changes</summary>

add the ability to skip the warm cold section check as naming conventions can vary

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


1 Files Affected:

- (modified) bolt/lib/Rewrite/RewriteInstance.cpp (+5-1) 


``````````diff
diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp
index 1a3a8af21d81b..b45f05507318a 100644
--- a/bolt/lib/Rewrite/RewriteInstance.cpp
+++ b/bolt/lib/Rewrite/RewriteInstance.cpp
@@ -246,6 +246,10 @@ static cl::opt<bool> WriteBoltInfoSection(
     "bolt-info", cl::desc("write bolt info section in the output binary"),
     cl::init(true), cl::Hidden, cl::cat(BoltOutputCategory));
 
+static cl::opt<bool> SplitFunctionCheck(
+    "split-function-check", cl::desc("check if binary contains cold warm split functions"),
+    cl::init(true), cl::Hidden, cl::cat(BoltOutputCategory));
+
 } // namespace opts
 
 // FIXME: implement a better way to mark sections for replacement.
@@ -1149,7 +1153,7 @@ void RewriteInstance::discoverFileObjects() {
     }
 
     // Check if it's a cold function fragment.
-    if (FunctionFragmentTemplate.match(SymName)) {
+    if (opts::SplitFunctionCheck && FunctionFragmentTemplate.match(SymName)) {
       static bool PrintedWarning = false;
       if (!PrintedWarning) {
         PrintedWarning = true;

``````````

</details>


https://github.com/llvm/llvm-project/pull/95322


More information about the llvm-commits mailing list