[llvm] [BOLT] [Passes] Fix two compile warnings in BOLT (PR #73086)

Rafael Auler via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 4 14:28:19 PST 2023


================
@@ -1467,7 +1466,7 @@ void IndirectCallPromotion::runOnFunctions(BinaryContext &BC) {
                                std::max<uint64_t>(TotalIndexBasedCandidates, 1))
          << "%\n";
 
-  (void)verifyProfile;
+  (void)verifyProfile(BFs);
----------------
rafaelauler wrote:

This is not the same. This will run verifyProfile(), which will cause an unnecessary slow down in no-debug mode. The previous code wasn't running anything, it was just making a reference to silence a compiler warning about verifyProfile being unused.

I believe the proper fix is actually to surround the definition of verifyProfile in #ifndef NDEBUG..#endif in the same way as it is use is.

https://github.com/llvm/llvm-project/pull/73086


More information about the llvm-commits mailing list