[RISCV] isImpliedByDomCondition returns an Optional<bool> not a bool.

We were incorrectly checking that it returned an implicaton result,
not that the implication result itself was true.
This commit is contained in:
Craig Topper 2022-08-12 22:15:22 -07:00
parent 50f305017d
commit 37db283362
1 changed files with 2 additions and 2 deletions

View File

@ -73,7 +73,7 @@ bool RISCVCodeGenPrepare::visitZExtInst(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());
@ -139,7 +139,7 @@ bool RISCVCodeGenPrepare::visitAnd(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.