diff options
Diffstat (limited to 'llvm/lib/Analysis/Lint.cpp')
-rw-r--r-- | llvm/lib/Analysis/Lint.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/Lint.cpp b/llvm/lib/Analysis/Lint.cpp index fdf5f55dab9..0b374bad129 100644 --- a/llvm/lib/Analysis/Lint.cpp +++ b/llvm/lib/Analysis/Lint.cpp @@ -680,9 +680,9 @@ Value *Lint::findValueImpl(Value *V, bool OffsetOk, if (Instruction *Inst = dyn_cast<Instruction>(V)) { if (Value *W = SimplifyInstruction(Inst, *DL, TLI, DT, AC)) return findValueImpl(W, OffsetOk, Visited); - } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) { - if (Value *W = ConstantFoldConstantExpression(CE, *DL, TLI)) - if (W != V) + } else if (auto *C = dyn_cast<Constant>(V)) { + if (Value *W = ConstantFoldConstant(C, *DL, TLI)) + if (W && W != V) return findValueImpl(W, OffsetOk, Visited); } |