[PATCH] D125475: [BOLT][NFC] Suppress unused variable warnings
Amir Ayupov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 13 12:10:31 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rG139744ac5388: [BOLT][NFC] Suppress unused variable warnings (authored by Amir).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125475/new/
https://reviews.llvm.org/D125475
Files:
bolt/lib/Core/BinaryFunction.cpp
bolt/lib/Core/DebugData.cpp
bolt/lib/Passes/RegReAssign.cpp
bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
bolt/lib/Target/X86/X86MCPlusBuilder.cpp
Index: bolt/lib/Target/X86/X86MCPlusBuilder.cpp
===================================================================
--- bolt/lib/Target/X86/X86MCPlusBuilder.cpp
+++ bolt/lib/Target/X86/X86MCPlusBuilder.cpp
@@ -1744,9 +1744,8 @@
bool convertCallToIndirectCall(MCInst &Inst, const MCSymbol *TargetLocation,
MCContext *Ctx) override {
- bool IsTailCall = isTailCall(Inst);
assert((Inst.getOpcode() == X86::CALL64pcrel32 ||
- (Inst.getOpcode() == X86::JMP_4 && IsTailCall)) &&
+ (Inst.getOpcode() == X86::JMP_4 && isTailCall(Inst))) &&
"64-bit direct (tail) call instruction expected");
const auto NewOpcode =
(Inst.getOpcode() == X86::CALL64pcrel32) ? X86::CALL64m : X86::JMP32m;
Index: bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
===================================================================
--- bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
+++ bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
@@ -763,6 +763,7 @@
assert(Adrp->getOperand(1).isImm() && "Unexpected adrp operand");
bool Ret = evaluateMemOperandTarget(*Adrp, Base, AdrpPC, InstSize);
assert(Ret && "Failed to evaluate adrp");
+ (void)Ret;
return Base + Offset;
}
Index: bolt/lib/Passes/RegReAssign.cpp
===================================================================
--- bolt/lib/Passes/RegReAssign.cpp
+++ bolt/lib/Passes/RegReAssign.cpp
@@ -349,6 +349,7 @@
LLVM_DEBUG(dbgs() << "\n ** Swapping " << BC.MRI->getName(RBX) << " with "
<< BC.MRI->getName(Candidate) << "\n\n");
+ (void)BC;
swap(Function, RBX, Candidate);
FuncsChanged.insert(&Function);
return true;
Index: bolt/lib/Core/DebugData.cpp
===================================================================
--- bolt/lib/Core/DebugData.cpp
+++ bolt/lib/Core/DebugData.cpp
@@ -598,6 +598,7 @@
assert(Patch.Index == DebugLoclistWriter::InvalidIndex ||
Patch.Index == Index++ && "Gap in LocList Index Array.");
+ (void)Index;
std::vector<uint64_t> OffsetsArray;
for (const DebugLocationEntry &Entry : Patch.LocList) {
Index: bolt/lib/Core/BinaryFunction.cpp
===================================================================
--- bolt/lib/Core/BinaryFunction.cpp
+++ bolt/lib/Core/BinaryFunction.cpp
@@ -688,6 +688,7 @@
assert((Opcode == dwarf::DW_CFA_expression ||
Opcode == dwarf::DW_CFA_val_expression) &&
"invalid DWARF expression CFI");
+ (void)Opcode;
const uint8_t *const Start =
reinterpret_cast<const uint8_t *>(ExprBytes.drop_front(1).data());
const uint8_t *const End =
@@ -1097,7 +1098,6 @@
auto handleExternalReference = [&](MCInst &Instruction, uint64_t Size,
uint64_t Offset, uint64_t TargetAddress,
bool &IsCall) -> MCSymbol * {
- const bool IsCondBranch = MIB->isConditionalBranch(Instruction);
const uint64_t AbsoluteInstrAddr = getAddress() + Offset;
MCSymbol *TargetSymbol = nullptr;
InterproceduralReferences.insert(TargetAddress);
@@ -1115,7 +1115,8 @@
// treated as calls.
if (!IsCall) {
if (!MIB->convertJmpToTailCall(Instruction)) {
- assert(IsCondBranch && "unknown tail call instruction");
+ assert(MIB->isConditionalBranch(Instruction) &&
+ "unknown tail call instruction");
if (opts::Verbosity >= 2) {
errs() << "BOLT-WARNING: conditional tail call detected in "
<< "function " << *this << " at 0x"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125475.429323.patch
Type: text/x-patch
Size: 3576 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220513/b6cbb0b8/attachment.bin>
More information about the llvm-commits
mailing list