forked from OSchip/llvm-project
[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:
parent
50f305017d
commit
37db283362
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue