[PATCH] D119673: [BOLT] Skip warning message if no functions were ignored

Maksim Panchenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 14 10:32:22 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG641e92d46b2a: [BOLT] Skip warning message if no functions were ignored (authored by maksfb).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119673

Files:
  bolt/lib/Core/BinaryContext.cpp
  bolt/test/X86/split-func-icf.s


Index: bolt/test/X86/split-func-icf.s
===================================================================
--- bolt/test/X86/split-func-icf.s
+++ bolt/test/X86/split-func-icf.s
@@ -16,7 +16,7 @@
 # CHECK-DAG: BOLT-WARNING: Ignoring main2
 # CHECK-DAG: BOLT-WARNING: Ignoring main
 # CHECK-DAG: BOLT-WARNING: Ignoring main2.cold.1(*2)
-# CHECK: BOLT-WARNING: Ignored 3 functions due to cold fragments.
+# CHECK: BOLT-WARNING: ignored 3 functions due to cold fragments
   .text
   .globl main
   .type main, %function
Index: bolt/lib/Core/BinaryContext.cpp
===================================================================
--- bolt/lib/Core/BinaryContext.cpp
+++ bolt/lib/Core/BinaryContext.cpp
@@ -712,8 +712,10 @@
     std::for_each(BF->ParentFragments.begin(), BF->ParentFragments.end(),
                   addToWorklist);
   }
-  errs() << "BOLT-WARNING: Ignored " << FragmentsToSkip.size() << " functions "
-         << "due to cold fragments.\n";
+  if (!FragmentsToSkip.empty())
+    errs() << "BOLT-WARNING: ignored " << FragmentsToSkip.size() << " function"
+           << (FragmentsToSkip.size() == 1 ? "" : "s")
+           << " due to cold fragments\n";
   FragmentsToSkip.clear();
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119673.408495.patch
Type: text/x-patch
Size: 1198 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220214/c9dff2ad/attachment.bin>


More information about the llvm-commits mailing list