[llvm] [BOLT] [Passes] Fix two compile warnings in BOLT (PR #73086)
Ho Cheung via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 5 21:42:11 PST 2023
https://github.com/gz83 updated https://github.com/llvm/llvm-project/pull/73086
>From be2b28180678fe0c006058f3ef06a6e44722a708 Mon Sep 17 00:00:00 2001
From: Ho Cheung <uioptt24 at gmail.com>
Date: Wed, 22 Nov 2023 13:02:04 +0800
Subject: [PATCH] [BOLT] [Passes] Fix two compile warnings in BOLT
Fix build issue on Windows.
issue:#73085
---
bolt/lib/Passes/IndirectCallPromotion.cpp | 3 ++-
bolt/lib/Passes/ReorderAlgorithm.cpp | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/bolt/lib/Passes/IndirectCallPromotion.cpp b/bolt/lib/Passes/IndirectCallPromotion.cpp
index 8b084c3b63d56..f40f5e7acbf3b 100644
--- a/bolt/lib/Passes/IndirectCallPromotion.cpp
+++ b/bolt/lib/Passes/IndirectCallPromotion.cpp
@@ -158,6 +158,7 @@ static cl::opt<bool> ICPPeelForInline(
} // namespace opts
+#ifndef NDEBUG
static bool verifyProfile(std::map<uint64_t, BinaryFunction> &BFs) {
bool IsValid = true;
for (auto &BFI : BFs) {
@@ -182,6 +183,7 @@ static bool verifyProfile(std::map<uint64_t, BinaryFunction> &BFs) {
}
return IsValid;
}
+#endif
namespace llvm {
namespace bolt {
@@ -1467,7 +1469,6 @@ void IndirectCallPromotion::runOnFunctions(BinaryContext &BC) {
std::max<uint64_t>(TotalIndexBasedCandidates, 1))
<< "%\n";
- (void)verifyProfile;
#ifndef NDEBUG
verifyProfile(BFs);
#endif
diff --git a/bolt/lib/Passes/ReorderAlgorithm.cpp b/bolt/lib/Passes/ReorderAlgorithm.cpp
index 3c3365e1d3d71..c112e1a8dcea7 100644
--- a/bolt/lib/Passes/ReorderAlgorithm.cpp
+++ b/bolt/lib/Passes/ReorderAlgorithm.cpp
@@ -20,7 +20,7 @@
#include <random>
#include <stack>
-#undef DEBUG_TYPE
+#undef DEBUG_TYPE
#define DEBUG_TYPE "bolt"
using namespace llvm;
@@ -425,7 +425,7 @@ void TSPReorderAlgorithm::reorderBasicBlocks(BinaryFunction &BF,
}
std::vector<std::vector<int64_t>> DP;
- DP.resize(1 << N);
+ DP.resize(static_cast<size_t>(1) << N);
for (std::vector<int64_t> &Elmt : DP)
Elmt.resize(N, -1);
More information about the llvm-commits
mailing list