@@ -2417,10 +2417,8 @@ unsigned RISCVTargetLowering::getVectorTypeBreakdownForCallingConv(
24172417// in the RISC-V ISA. May adjust compares to favor compare with 0 over compare
24182418// with 1/-1.
24192419static void translateSetCCForBranch(const SDLoc &DL, SDValue &LHS, SDValue &RHS,
2420- ISD::CondCode &CC, SelectionDAG &DAG) {
2421- const RISCVSubtarget &Subtarget =
2422- DAG.getMachineFunction().getSubtarget<RISCVSubtarget>();
2423-
2420+ ISD::CondCode &CC, SelectionDAG &DAG,
2421+ const RISCVSubtarget &Subtarget) {
24242422 // If this is a single bit test that can't be handled by ANDI, shift the
24252423 // bit to be tested to the MSB and perform a signed compare with 0.
24262424 if (isIntEqualitySetCC(CC) && isNullConstant(RHS) &&
@@ -9238,7 +9236,7 @@ SDValue RISCVTargetLowering::lowerSELECT(SDValue Op, SelectionDAG &DAG) const {
92389236 return DAG.getNode(ISD::SUB, DL, VT, FalseV, CondV);
92399237 }
92409238
9241- translateSetCCForBranch(DL, LHS, RHS, CCVal, DAG);
9239+ translateSetCCForBranch(DL, LHS, RHS, CCVal, DAG, Subtarget );
92429240 // 1 < x ? x : 1 -> 0 < x ? x : 1
92439241 if (isOneConstant(LHS) && (CCVal == ISD::SETLT || CCVal == ISD::SETULT) &&
92449242 RHS == TrueV && LHS == FalseV) {
@@ -9280,7 +9278,7 @@ SDValue RISCVTargetLowering::lowerBRCOND(SDValue Op, SelectionDAG &DAG) const {
92809278 SDValue RHS = CondV.getOperand(1);
92819279 ISD::CondCode CCVal = cast<CondCodeSDNode>(CondV.getOperand(2))->get();
92829280
9283- translateSetCCForBranch(DL, LHS, RHS, CCVal, DAG);
9281+ translateSetCCForBranch(DL, LHS, RHS, CCVal, DAG, Subtarget );
92849282
92859283 SDValue TargetCC = DAG.getCondCode(CCVal);
92869284 return DAG.getNode(RISCVISD::BR_CC, DL, Op.getValueType(), Op.getOperand(0),
@@ -18224,7 +18222,7 @@ static bool combine_CC(SDValue &LHS, SDValue &RHS, SDValue &CC, const SDLoc &DL,
1822418222
1822518223 RHS = LHS.getOperand(1);
1822618224 LHS = LHS.getOperand(0);
18227- translateSetCCForBranch(DL, LHS, RHS, CCVal, DAG);
18225+ translateSetCCForBranch(DL, LHS, RHS, CCVal, DAG, Subtarget );
1822818226
1822918227 CC = DAG.getCondCode(CCVal);
1823018228 return true;
0 commit comments