[PATCH] D131283: [BOLT] Disable -lite when split function is present

Huan Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 5 14:47:45 PDT 2022


nhuhuan updated this revision to Diff 450419.
nhuhuan added a comment.

Avoid printing duplicate warnings.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131283/new/

https://reviews.llvm.org/D131283

Files:
  bolt/lib/Rewrite/RewriteInstance.cpp


Index: bolt/lib/Rewrite/RewriteInstance.cpp
===================================================================
--- bolt/lib/Rewrite/RewriteInstance.cpp
+++ bolt/lib/Rewrite/RewriteInstance.cpp
@@ -1428,10 +1428,15 @@
         Function.hasRestoredNameRegex(".*\\.cold(\\.[0-9]+)?");
     if (FragName) {
       static bool PrintedWarning = false;
-      if (BC->HasRelocations && !PrintedWarning) {
-        errs() << "BOLT-WARNING: split function detected on input : "
-               << *FragName << ". The support is limited in relocation mode.\n";
+      if (!PrintedWarning) {
         PrintedWarning = true;
+        errs() << "BOLT-WARNING: split function detected on input : "
+               << *FragName << ". ";
+        if (BC->HasRelocations)
+           errs() << "The support is limited in relocation mode.";
+        opts::Lite = false;
+        errs() << "\nBOLT-WARNING: disabling lite mode (-lite) when split "
+               << "functions are present.\n";
       }
       Function.IsFragment = true;
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131283.450419.patch
Type: text/x-patch
Size: 1028 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220805/cc60e305/attachment.bin>


More information about the llvm-commits mailing list