Skip to content

Commit

Permalink
[RISCV] Use isScalarInteger instead of isInteger. NFC
Browse files Browse the repository at this point in the history
The type should only be scalar here and the isScalarInteger
should be a simpler check.
  • Loading branch information
topperc committed Jul 16, 2023
1 parent ef1ccc4 commit d09109a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2482,7 +2482,7 @@ bool RISCVDAGToDAGISel::selectSETCC(SDValue N, ISD::CondCode ExpectedCCVal,
SDValue LHS = N->getOperand(0);
SDValue RHS = N->getOperand(1);

if (!LHS.getValueType().isInteger())
if (!LHS.getValueType().isScalarInteger())
return false;

// If the RHS side is 0, we don't need any extra instructions, return the LHS.
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/RISCV/RISCVISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5784,7 +5784,7 @@ static bool selectSETCC(SDValue N, ISD::CondCode ExpectedCCVal, SDValue &Val,
SDValue LHS = N->getOperand(0);
SDValue RHS = N->getOperand(1);

if (!LHS.getValueType().isInteger())
if (!LHS.getValueType().isScalarInteger())
return false;

// If the RHS side is 0, we don't need any extra instructions, return the LHS.
Expand Down Expand Up @@ -5904,7 +5904,7 @@ SDValue RISCVTargetLowering::lowerSELECT(SDValue Op, SelectionDAG &DAG) const {
// the SELECT. Performing the lowering here allows for greater control over
// when CZERO_{EQZ/NEZ} are used vs another branchless sequence or
// RISCVISD::SELECT_CC node (branch-based select).
if (Subtarget.hasStdExtZicond() && VT.isInteger()) {
if (Subtarget.hasStdExtZicond() && VT.isScalarInteger()) {
SDValue NewCondV;
if (selectSETCC(CondV, ISD::SETNE, NewCondV, DAG)) {
// (select (riscv_setne c), t, 0) -> (czero_eqz t, c)
Expand Down

0 comments on commit d09109a

Please sign in to comment.