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

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


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

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

>From 99bf15a21715118612998751e0dd3d135b79a46b Mon Sep 17 00:00:00 2001
From: Daniel Hill <dhhillaz at gmail.com>
Date: Wed, 12 Jun 2024 22:30:42 +0000
Subject: [PATCH] skip the warm cold check

---
 bolt/lib/Rewrite/RewriteInstance.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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;



More information about the llvm-commits mailing list