[llvm] [BOLT] Reduce CFI warning verbosity (PR #105336)

Maksim Panchenko via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 13:28:02 PDT 2024


https://github.com/maksfb created https://github.com/llvm/llvm-project/pull/105336

CFI programs may have more saves than restores and this is completely benign from BOLT's perspective. Reduce the verbosity and print the warning only under `-v=1` and above.

>From a11aa2db93b13fcbf31a427cadde069658c6f563 Mon Sep 17 00:00:00 2001
From: Maksim Panchenko <maks at fb.com>
Date: Tue, 20 Aug 2024 13:24:07 -0700
Subject: [PATCH] [BOLT] Reduce CFI warning verbosity

CFI programs may have more saves than restores and this is completely
benign from BOLT's perspective. Reduce the verbosity and print the
warning only under `-v=1` and above.
---
 bolt/lib/Core/BinaryFunction.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bolt/lib/Core/BinaryFunction.cpp b/bolt/lib/Core/BinaryFunction.cpp
index e5c6d551e42a7a..af982fd60b17e7 100644
--- a/bolt/lib/Core/BinaryFunction.cpp
+++ b/bolt/lib/Core/BinaryFunction.cpp
@@ -2502,7 +2502,7 @@ void BinaryFunction::annotateCFIState() {
     }
   }
 
-  if (!StateStack.empty()) {
+  if (opts::Verbosity >= 1 && !StateStack.empty()) {
     BC.errs() << "BOLT-WARNING: non-empty CFI stack at the end of " << *this
               << '\n';
   }



More information about the llvm-commits mailing list