Skip to content

Commit e2e6846

Browse files
[RISCV] Use isNullConstant (NFC)
1 parent 27bba42 commit e2e6846

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12906,12 +12906,10 @@ static bool combine_CC(SDValue &LHS, SDValue &RHS, SDValue &CC, const SDLoc &DL,
1290612906
// shift can be omitted.
1290712907
// Fold setlt (sra X, N), 0 -> setlt X, 0 and
1290812908
// setge (sra X, N), 0 -> setge X, 0
12909-
if (auto *RHSConst = dyn_cast<ConstantSDNode>(RHS.getNode())) {
12910-
if ((CCVal == ISD::SETGE || CCVal == ISD::SETLT) &&
12911-
LHS.getOpcode() == ISD::SRA && RHSConst->isZero()) {
12912-
LHS = LHS.getOperand(0);
12913-
return true;
12914-
}
12909+
if (isNullConstant(RHS) && (CCVal == ISD::SETGE || CCVal == ISD::SETLT) &&
12910+
LHS.getOpcode() == ISD::SRA) {
12911+
LHS = LHS.getOperand(0);
12912+
return true;
1291512913
}
1291612914

1291712915
if (!ISD::isIntEqualitySetCC(CCVal))

0 commit comments

Comments
 (0)