From aff271930e8ac2ca520ba92cf6d736f94edfaaf6 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Mon, 30 May 2022 16:21:38 +0000 Subject: [PATCH] Fix warning for unused variable in the non-assert build (NFC) --- llvm/lib/Analysis/ValueTracking.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 5adf44f..04752c4 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -4607,6 +4607,7 @@ bool llvm::isSafeToSpeculativelyExecuteWithOpcode(unsigned Opcode, const Instruction *CtxI, const DominatorTree *DT, const TargetLibraryInfo *TLI) { +#ifndef NDEBUG if (Inst->getOpcode() != Opcode) { // Check that the operands are actually compatible with the Opcode override. auto hasEqualReturnAndLeadingOperandTypes = @@ -4624,6 +4625,7 @@ bool llvm::isSafeToSpeculativelyExecuteWithOpcode(unsigned Opcode, assert(!Instruction::isUnaryOp(Opcode) || hasEqualReturnAndLeadingOperandTypes(Inst, 1)); } +#endif for (unsigned i = 0, e = Inst->getNumOperands(); i != e; ++i) if (Constant *C = dyn_cast(Inst->getOperand(i))) -- 2.7.4