aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
authorMehdi Amini <joker.eph@gmail.com>2022-05-30 16:21:38 +0000
committerMehdi Amini <joker.eph@gmail.com>2022-05-30 16:21:38 +0000
commitaff271930e8ac2ca520ba92cf6d736f94edfaaf6 (patch)
treecbc8ecca004016ba951e5569487cac56f2ab82b8 /llvm/lib/Analysis/ValueTracking.cpp
parent1e01b1ec72031fcaceb4e77e1c5c8e34f1e862e8 (diff)
downloadllvm-aff271930e8ac2ca520ba92cf6d736f94edfaaf6.zip
llvm-aff271930e8ac2ca520ba92cf6d736f94edfaaf6.tar.gz
llvm-aff271930e8ac2ca520ba92cf6d736f94edfaaf6.tar.bz2
Fix warning for unused variable in the non-assert build (NFC)
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp2
1 files changed, 2 insertions, 0 deletions
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<Constant>(Inst->getOperand(i)))