CondV.getOperand(0).getSimpleValueType() == XLenVT) {
SDValue LHS = CondV.getOperand(0);
SDValue RHS = CondV.getOperand(1);
- const auto *CC = cast<CondCodeSDNode>(CondV.getOperand(2));
- ISD::CondCode CCVal = CC->get();
+ ISD::CondCode CCVal = cast<CondCodeSDNode>(CondV.getOperand(2))->get();
// Special case for a select of 2 constants that have a diffence of 1.
// Normally this is done by DAGCombine, but if the select is introduced by
const APInt &TrueVal = cast<ConstantSDNode>(TrueV)->getAPIntValue();
const APInt &FalseVal = cast<ConstantSDNode>(FalseV)->getAPIntValue();
if (TrueVal - 1 == FalseVal)
- return DAG.getNode(ISD::ADD, DL, Op.getValueType(), CondV, FalseV);
+ return DAG.getNode(ISD::ADD, DL, VT, CondV, FalseV);
if (TrueVal + 1 == FalseVal)
- return DAG.getNode(ISD::SUB, DL, Op.getValueType(), FalseV, CondV);
+ return DAG.getNode(ISD::SUB, DL, VT, FalseV, CondV);
}
translateSetCCForBranch(DL, LHS, RHS, CCVal, DAG);
SDValue TargetCC = DAG.getCondCode(CCVal);
SDValue Ops[] = {LHS, RHS, TargetCC, TrueV, FalseV};
- return DAG.getNode(RISCVISD::SELECT_CC, DL, Op.getValueType(), Ops);
+ return DAG.getNode(RISCVISD::SELECT_CC, DL, VT, Ops);
}
// Otherwise:
SDValue Ops[] = {CondV, Zero, SetNE, TrueV, FalseV};
- return DAG.getNode(RISCVISD::SELECT_CC, DL, Op.getValueType(), Ops);
+ return DAG.getNode(RISCVISD::SELECT_CC, DL, VT, Ops);
}
SDValue RISCVTargetLowering::lowerBRCOND(SDValue Op, SelectionDAG &DAG) const {