diff options
Diffstat (limited to 'llvm/lib/Target/RISCV/RISCVCodeGenPrepare.cpp')
-rw-r--r-- | llvm/lib/Target/RISCV/RISCVCodeGenPrepare.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/RISCV/RISCVCodeGenPrepare.cpp b/llvm/lib/Target/RISCV/RISCVCodeGenPrepare.cpp index a19253da440e..1b5bd4c00089 100644 --- a/llvm/lib/Target/RISCV/RISCVCodeGenPrepare.cpp +++ b/llvm/lib/Target/RISCV/RISCVCodeGenPrepare.cpp @@ -71,7 +71,7 @@ bool RISCVCodeGenPrepare::optimizeZExt(ZExtInst *ZExt) { // This often occurs with widened induction variables. if (isImpliedByDomCondition(ICmpInst::ICMP_SGE, Src, Constant::getNullValue(Src->getType()), ZExt, - *DL)) { + *DL).value_or(false)) { auto *SExt = new SExtInst(Src, ZExt->getType(), "", ZExt); SExt->takeName(ZExt); SExt->setDebugLoc(ZExt->getDebugLoc()); @@ -140,7 +140,7 @@ bool RISCVCodeGenPrepare::optimizeAndExt(BinaryOperator *BO) { // And mask constant. if (!isImpliedByDomCondition(ICmpInst::ICMP_SGE, LHSSrc, Constant::getNullValue(LHSSrc->getType()), - LHS, *DL)) + LHS, *DL).value_or(false)) return false; // Sign extend the constant and replace the And operand. |