Skip to content

Commit f1f55a9

Browse files
topperctru
authored andcommitted
[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.
1 parent e4aa104 commit f1f55a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/RISCV/RISCVCodeGenPrepare.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ bool RISCVCodeGenPrepare::optimizeZExt(ZExtInst *ZExt) {
7171
// This often occurs with widened induction variables.
7272
if (isImpliedByDomCondition(ICmpInst::ICMP_SGE, Src,
7373
Constant::getNullValue(Src->getType()), ZExt,
74-
*DL)) {
74+
*DL).value_or(false)) {
7575
auto *SExt = new SExtInst(Src, ZExt->getType(), "", ZExt);
7676
SExt->takeName(ZExt);
7777
SExt->setDebugLoc(ZExt->getDebugLoc());
@@ -140,7 +140,7 @@ bool RISCVCodeGenPrepare::optimizeAndExt(BinaryOperator *BO) {
140140
// And mask constant.
141141
if (!isImpliedByDomCondition(ICmpInst::ICMP_SGE, LHSSrc,
142142
Constant::getNullValue(LHSSrc->getType()),
143-
LHS, *DL))
143+
LHS, *DL).value_or(false))
144144
return false;
145145

146146
// Sign extend the constant and replace the And operand.

0 commit comments

Comments
 (0)