[llvm] f6df5cd - [CtxProf] Fix warnings

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 6 14:57:49 PDT 2024


Author: Kazu Hirata
Date: 2024-09-06T14:57:43-07:00
New Revision: f6df5cd24d5e80eb6f92a83f52c10aed3c406a2e

URL: https://github.com/llvm/llvm-project/commit/f6df5cd24d5e80eb6f92a83f52c10aed3c406a2e
DIFF: https://github.com/llvm/llvm-project/commit/f6df5cd24d5e80eb6f92a83f52c10aed3c406a2e.diff

LOG: [CtxProf] Fix warnings

This patch fixes:

  llvm/lib/Transforms/Instrumentation/PGOCtxProfFlattening.cpp:214:14:
  error: unused variable 'Index' [-Werror,-Wunused-variable]

  llvm/lib/Transforms/Instrumentation/PGOCtxProfFlattening.cpp:284:6:
  error: unused function 'areAllBBsReachable'
  [-Werror,-Wunused-function]

Added: 
    

Modified: 
    llvm/lib/Transforms/Instrumentation/PGOCtxProfFlattening.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Instrumentation/PGOCtxProfFlattening.cpp b/llvm/lib/Transforms/Instrumentation/PGOCtxProfFlattening.cpp
index d4224135f771b7..3fc0de7cabe322 100644
--- a/llvm/lib/Transforms/Instrumentation/PGOCtxProfFlattening.cpp
+++ b/llvm/lib/Transforms/Instrumentation/PGOCtxProfFlattening.cpp
@@ -216,6 +216,7 @@ class ProfileAnnotator final {
                "The index must be inside the counters vector by construction - "
                "tripping this assertion indicates a bug in how the contextual "
                "profile is managed by IPO transforms");
+        (void)Index;
         Count = Counters[Ins->getIndex()->getZExtValue()];
       }
       auto [It, Ins] =
@@ -280,7 +281,8 @@ class ProfileAnnotator final {
   }
 };
 
-bool areAllBBsReachable(const Function &F, FunctionAnalysisManager &FAM) {
+[[maybe_unused]] bool areAllBBsReachable(const Function &F,
+                                         FunctionAnalysisManager &FAM) {
   auto &DT = FAM.getResult<DominatorTreeAnalysis>(const_cast<Function &>(F));
   return llvm::all_of(
       F, [&](const BasicBlock &BB) { return DT.isReachableFromEntry(&BB); });


        


More information about the llvm-commits mailing list