Skip to content

Commit 724865e

Browse files
committed
[AArch64] Consistently use CondCodeVT, add getCondCode() helper
1 parent 98562ff commit 724865e

File tree

2 files changed

+67
-63
lines changed

2 files changed

+67
-63
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 54 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ static cl::opt<bool> UseFEATCPACodegen(
162162
cl::init(false));
163163

164164
/// Value type used for condition codes.
165-
static const MVT MVT_CC = MVT::i32;
165+
constexpr MVT CondCodeVT = MVT::i32;
166166

167167
/// Value type used for NZCV flags.
168-
static constexpr MVT FlagsVT = MVT::i32;
168+
constexpr MVT FlagsVT = MVT::i32;
169169

170170
static const MCPhysReg GPRArgRegs[] = {AArch64::X0, AArch64::X1, AArch64::X2,
171171
AArch64::X3, AArch64::X4, AArch64::X5,
@@ -3390,6 +3390,12 @@ static void changeVectorFPCCToAArch64CC(ISD::CondCode CC,
33903390
}
33913391
}
33923392

3393+
/// Like SelectionDAG::getCondCode(), but for AArch64 condition codes.
3394+
static SDValue getCondCode(SelectionDAG &DAG, AArch64CC::CondCode CC) {
3395+
// TODO: Should be TargetConstant (need to s/imm/timm in patterns).
3396+
return DAG.getConstant(CC, SDLoc(), CondCodeVT);
3397+
}
3398+
33933399
static bool isLegalArithImmed(uint64_t C) {
33943400
// Matches AArch64DAGToDAGISel::SelectArithImmed().
33953401
bool IsLegal = (C >> 12 == 0) || ((C & 0xFFFULL) == 0 && C >> 24 == 0);
@@ -3596,7 +3602,7 @@ static SDValue emitConditionalComparison(SDValue LHS, SDValue RHS,
35963602
if (Opcode == 0)
35973603
Opcode = AArch64ISD::CCMP;
35983604

3599-
SDValue Condition = DAG.getConstant(Predicate, DL, MVT_CC);
3605+
SDValue Condition = getCondCode(DAG, Predicate);
36003606
AArch64CC::CondCode InvOutCC = AArch64CC::getInvertedCondCode(OutCC);
36013607
unsigned NZCV = AArch64CC::getNZCVToSatisfyCondCode(InvOutCC);
36023608
SDValue NZCVOp = DAG.getConstant(NZCV, DL, MVT::i32);
@@ -3993,7 +3999,7 @@ static SDValue getAArch64Cmp(SDValue LHS, SDValue RHS, ISD::CondCode CC,
39933999
Cmp = emitComparison(LHS, RHS, CC, DL, DAG);
39944000
AArch64CC = changeIntCCToAArch64CC(CC);
39954001
}
3996-
AArch64cc = DAG.getConstant(AArch64CC, DL, MVT_CC);
4002+
AArch64cc = getCondCode(DAG, AArch64CC);
39974003
return Cmp;
39984004
}
39994005

@@ -4113,7 +4119,7 @@ SDValue AArch64TargetLowering::LowerXOR(SDValue Op, SelectionDAG &DAG) const {
41134119
AArch64CC::CondCode CC;
41144120
SDValue Value, Overflow;
41154121
std::tie(Value, Overflow) = getAArch64XALUOOp(CC, Sel.getValue(0), DAG);
4116-
SDValue CCVal = DAG.getConstant(getInvertedCondCode(CC), DL, MVT::i32);
4122+
SDValue CCVal = getCondCode(DAG, getInvertedCondCode(CC));
41174123
return DAG.getNode(AArch64ISD::CSEL, DL, Op.getValueType(), TVal, FVal,
41184124
CCVal, Overflow);
41194125
}
@@ -4192,8 +4198,8 @@ static SDValue carryFlagToValue(SDValue Glue, EVT VT, SelectionDAG &DAG,
41924198
SDLoc DL(Glue);
41934199
SDValue Zero = DAG.getConstant(0, DL, VT);
41944200
SDValue One = DAG.getConstant(1, DL, VT);
4195-
unsigned Cond = Invert ? AArch64CC::LO : AArch64CC::HS;
4196-
SDValue CC = DAG.getConstant(Cond, DL, MVT::i32);
4201+
AArch64CC::CondCode Cond = Invert ? AArch64CC::LO : AArch64CC::HS;
4202+
SDValue CC = getCondCode(DAG, Cond);
41974203
return DAG.getNode(AArch64ISD::CSEL, DL, VT, One, Zero, CC, Glue);
41984204
}
41994205

@@ -4203,7 +4209,7 @@ static SDValue overflowFlagToValue(SDValue Glue, EVT VT, SelectionDAG &DAG) {
42034209
SDLoc DL(Glue);
42044210
SDValue Zero = DAG.getConstant(0, DL, VT);
42054211
SDValue One = DAG.getConstant(1, DL, VT);
4206-
SDValue CC = DAG.getConstant(AArch64CC::VS, DL, MVT::i32);
4212+
SDValue CC = getCondCode(DAG, AArch64CC::VS);
42074213
return DAG.getNode(AArch64ISD::CSEL, DL, VT, One, Zero, CC, Glue);
42084214
}
42094215

@@ -4253,7 +4259,7 @@ static SDValue LowerXALUO(SDValue Op, SelectionDAG &DAG) {
42534259
// We use an inverted condition, because the conditional select is inverted
42544260
// too. This will allow it to be selected to a single instruction:
42554261
// CSINC Wd, WZR, WZR, invert(cond).
4256-
SDValue CCVal = DAG.getConstant(getInvertedCondCode(CC), DL, MVT::i32);
4262+
SDValue CCVal = getCondCode(DAG, getInvertedCondCode(CC));
42574263
Overflow =
42584264
DAG.getNode(AArch64ISD::CSEL, DL, MVT::i32, FVal, TVal, CCVal, Overflow);
42594265

@@ -7043,8 +7049,7 @@ SDValue AArch64TargetLowering::LowerABS(SDValue Op, SelectionDAG &DAG) const {
70437049
SDValue Cmp = DAG.getNode(AArch64ISD::SUBS, DL, DAG.getVTList(VT, FlagsVT),
70447050
Op.getOperand(0), DAG.getConstant(0, DL, VT));
70457051
return DAG.getNode(AArch64ISD::CSEL, DL, VT, Op.getOperand(0), Neg,
7046-
DAG.getConstant(AArch64CC::PL, DL, MVT::i32),
7047-
Cmp.getValue(1));
7052+
getCondCode(DAG, AArch64CC::PL), Cmp.getValue(1));
70487053
}
70497054

70507055
static SDValue LowerBRCOND(SDValue Op, SelectionDAG &DAG) {
@@ -7055,7 +7060,7 @@ static SDValue LowerBRCOND(SDValue Op, SelectionDAG &DAG) {
70557060
AArch64CC::CondCode CC;
70567061
if (SDValue Cmp = emitConjunction(DAG, Cond, CC)) {
70577062
SDLoc DL(Op);
7058-
SDValue CCVal = DAG.getConstant(CC, DL, MVT::i32);
7063+
SDValue CCVal = getCondCode(DAG, CC);
70597064
return DAG.getNode(AArch64ISD::BRCOND, DL, MVT::Other, Chain, Dest, CCVal,
70607065
Cmp);
70617066
}
@@ -10489,7 +10494,7 @@ SDValue AArch64TargetLowering::LowerBR_CC(SDValue Op, SelectionDAG &DAG) const {
1048910494

1049010495
if (CC == ISD::SETNE)
1049110496
OFCC = getInvertedCondCode(OFCC);
10492-
SDValue CCVal = DAG.getConstant(OFCC, DL, MVT::i32);
10497+
SDValue CCVal = getCondCode(DAG, OFCC);
1049310498

1049410499
return DAG.getNode(AArch64ISD::BRCOND, DL, MVT::Other, Chain, Dest, CCVal,
1049510500
Overflow);
@@ -10562,7 +10567,7 @@ SDValue AArch64TargetLowering::LowerBR_CC(SDValue Op, SelectionDAG &DAG) const {
1056210567
AArch64CC::isValidCBCond(changeIntCCToAArch64CC(CC)) &&
1056310568
ProduceNonFlagSettingCondBr) {
1056410569
SDValue Cond =
10565-
DAG.getTargetConstant(changeIntCCToAArch64CC(CC), DL, MVT::i32);
10570+
DAG.getTargetConstant(changeIntCCToAArch64CC(CC), DL, CondCodeVT);
1056610571
return DAG.getNode(AArch64ISD::CB, DL, MVT::Other, Chain, Cond, LHS, RHS,
1056710572
Dest);
1056810573
}
@@ -10581,11 +10586,11 @@ SDValue AArch64TargetLowering::LowerBR_CC(SDValue Op, SelectionDAG &DAG) const {
1058110586
SDValue Cmp = emitComparison(LHS, RHS, CC, DL, DAG);
1058210587
AArch64CC::CondCode CC1, CC2;
1058310588
changeFPCCToAArch64CC(CC, CC1, CC2);
10584-
SDValue CC1Val = DAG.getConstant(CC1, DL, MVT::i32);
10589+
SDValue CC1Val = getCondCode(DAG, CC1);
1058510590
SDValue BR1 =
1058610591
DAG.getNode(AArch64ISD::BRCOND, DL, MVT::Other, Chain, Dest, CC1Val, Cmp);
1058710592
if (CC2 != AArch64CC::AL) {
10588-
SDValue CC2Val = DAG.getConstant(CC2, DL, MVT::i32);
10593+
SDValue CC2Val = getCondCode(DAG, CC2);
1058910594
return DAG.getNode(AArch64ISD::BRCOND, DL, MVT::Other, BR1, Dest, CC2Val,
1059010595
Cmp);
1059110596
}
@@ -11074,7 +11079,7 @@ SDValue AArch64TargetLowering::LowerSETCC(SDValue Op, SelectionDAG &DAG) const {
1107411079
if (CC2 == AArch64CC::AL) {
1107511080
changeFPCCToAArch64CC(ISD::getSetCCInverse(CC, LHS.getValueType()), CC1,
1107611081
CC2);
11077-
SDValue CC1Val = DAG.getConstant(CC1, DL, MVT::i32);
11082+
SDValue CC1Val = getCondCode(DAG, CC1);
1107811083

1107911084
// Note that we inverted the condition above, so we reverse the order of
1108011085
// the true and false operands here. This will allow the setcc to be
@@ -11087,11 +11092,11 @@ SDValue AArch64TargetLowering::LowerSETCC(SDValue Op, SelectionDAG &DAG) const {
1108711092
// of the first as the RHS. We're effectively OR'ing the two CC's together.
1108811093

1108911094
// FIXME: It would be nice if we could match the two CSELs to two CSINCs.
11090-
SDValue CC1Val = DAG.getConstant(CC1, DL, MVT::i32);
11095+
SDValue CC1Val = getCondCode(DAG, CC1);
1109111096
SDValue CS1 =
1109211097
DAG.getNode(AArch64ISD::CSEL, DL, VT, TVal, FVal, CC1Val, Cmp);
1109311098

11094-
SDValue CC2Val = DAG.getConstant(CC2, DL, MVT::i32);
11099+
SDValue CC2Val = getCondCode(DAG, CC2);
1109511100
Res = DAG.getNode(AArch64ISD::CSEL, DL, VT, TVal, CS1, CC2Val, Cmp);
1109611101
}
1109711102
return IsStrict ? DAG.getMergeValues({Res, Cmp.getValue(1)}, DL) : Res;
@@ -11119,8 +11124,7 @@ SDValue AArch64TargetLowering::LowerSETCCCARRY(SDValue Op,
1111911124

1112011125
ISD::CondCode Cond = cast<CondCodeSDNode>(Op.getOperand(3))->get();
1112111126
ISD::CondCode CondInv = ISD::getSetCCInverse(Cond, VT);
11122-
SDValue CCVal =
11123-
DAG.getConstant(changeIntCCToAArch64CC(CondInv), DL, MVT::i32);
11127+
SDValue CCVal = getCondCode(DAG, changeIntCCToAArch64CC(CondInv));
1112411128
// Inputs are swapped because the condition is inverted. This will allow
1112511129
// matching with a single CSINC instruction.
1112611130
return DAG.getNode(AArch64ISD::CSEL, DL, OpVT, FVal, TVal, CCVal,
@@ -11475,13 +11479,13 @@ SDValue AArch64TargetLowering::LowerSELECT_CC(
1147511479
}
1147611480

1147711481
// Emit first, and possibly only, CSEL.
11478-
SDValue CC1Val = DAG.getConstant(CC1, DL, MVT::i32);
11482+
SDValue CC1Val = getCondCode(DAG, CC1);
1147911483
SDValue CS1 = DAG.getNode(AArch64ISD::CSEL, DL, VT, TVal, FVal, CC1Val, Cmp);
1148011484

1148111485
// If we need a second CSEL, emit it, using the output of the first as the
1148211486
// RHS. We're effectively OR'ing the two CC's together.
1148311487
if (CC2 != AArch64CC::AL) {
11484-
SDValue CC2Val = DAG.getConstant(CC2, DL, MVT::i32);
11488+
SDValue CC2Val = getCondCode(DAG, CC2);
1148511489
return DAG.getNode(AArch64ISD::CSEL, DL, VT, TVal, CS1, CC2Val, Cmp);
1148611490
}
1148711491

@@ -11585,7 +11589,7 @@ SDValue AArch64TargetLowering::LowerSELECT(SDValue Op,
1158511589
AArch64CC::CondCode OFCC;
1158611590
SDValue Value, Overflow;
1158711591
std::tie(Value, Overflow) = getAArch64XALUOOp(OFCC, CCVal.getValue(0), DAG);
11588-
SDValue CCVal = DAG.getConstant(OFCC, DL, MVT::i32);
11592+
SDValue CCVal = getCondCode(DAG, OFCC);
1158911593

1159011594
return DAG.getNode(AArch64ISD::CSEL, DL, Op.getValueType(), TVal, FVal,
1159111595
CCVal, Overflow);
@@ -12423,10 +12427,10 @@ static AArch64CC::CondCode parseConstraintCode(llvm::StringRef Constraint) {
1242312427
/// WZR, invert(<cond>)'.
1242412428
static SDValue getSETCC(AArch64CC::CondCode CC, SDValue NZCV, const SDLoc &DL,
1242512429
SelectionDAG &DAG) {
12426-
return DAG.getNode(
12427-
AArch64ISD::CSINC, DL, MVT::i32, DAG.getConstant(0, DL, MVT::i32),
12428-
DAG.getConstant(0, DL, MVT::i32),
12429-
DAG.getConstant(getInvertedCondCode(CC), DL, MVT::i32), NZCV);
12430+
return DAG.getNode(AArch64ISD::CSINC, DL, MVT::i32,
12431+
DAG.getConstant(0, DL, MVT::i32),
12432+
DAG.getConstant(0, DL, MVT::i32),
12433+
getCondCode(DAG, getInvertedCondCode(CC)), NZCV);
1243012434
}
1243112435

1243212436
// Lower @cc flag output via getSETCC.
@@ -18594,7 +18598,7 @@ AArch64TargetLowering::BuildSREMPow2(SDNode *N, const APInt &Divisor,
1859418598
Created.push_back(Cmp.getNode());
1859518599
Created.push_back(And.getNode());
1859618600
} else {
18597-
SDValue CCVal = DAG.getConstant(AArch64CC::MI, DL, MVT_CC);
18601+
SDValue CCVal = getCondCode(DAG, AArch64CC::MI);
1859818602
SDVTList VTs = DAG.getVTList(VT, FlagsVT);
1859918603

1860018604
SDValue Negs = DAG.getNode(AArch64ISD::SUBS, DL, VTs, Zero, N0);
@@ -19466,11 +19470,11 @@ static SDValue performANDORCSELCombine(SDNode *N, SelectionDAG &DAG) {
1946619470

1946719471
if (N->getOpcode() == ISD::AND) {
1946819472
AArch64CC::CondCode InvCC0 = AArch64CC::getInvertedCondCode(CC0);
19469-
Condition = DAG.getConstant(InvCC0, DL, MVT_CC);
19473+
Condition = getCondCode(DAG, InvCC0);
1947019474
NZCV = AArch64CC::getNZCVToSatisfyCondCode(CC1);
1947119475
} else {
1947219476
AArch64CC::CondCode InvCC1 = AArch64CC::getInvertedCondCode(CC1);
19473-
Condition = DAG.getConstant(CC0, DL, MVT_CC);
19477+
Condition = getCondCode(DAG, CC0);
1947419478
NZCV = AArch64CC::getNZCVToSatisfyCondCode(InvCC1);
1947519479
}
1947619480

@@ -19491,8 +19495,7 @@ static SDValue performANDORCSELCombine(SDNode *N, SelectionDAG &DAG) {
1949119495
Cmp1.getOperand(1), NZCVOp, Condition, Cmp0);
1949219496
}
1949319497
return DAG.getNode(AArch64ISD::CSEL, DL, VT, CSel0.getOperand(0),
19494-
CSel0.getOperand(1), DAG.getConstant(CC1, DL, MVT::i32),
19495-
CCmp);
19498+
CSel0.getOperand(1), getCondCode(DAG, CC1), CCmp);
1949619499
}
1949719500

1949819501
static SDValue performORCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI,
@@ -19697,7 +19700,7 @@ static SDValue performANDSETCCCombine(SDNode *N,
1969719700
SDLoc DL(N);
1969819701
return DAG.getNode(AArch64ISD::CSINC, DL, VT, DAG.getConstant(0, DL, VT),
1969919702
DAG.getConstant(0, DL, VT),
19700-
DAG.getConstant(InvertedCC, DL, MVT::i32), Cmp);
19703+
getCondCode(DAG, InvertedCC), Cmp);
1970119704
}
1970219705
}
1970319706
return SDValue();
@@ -20688,7 +20691,7 @@ static SDValue performAddCSelIntoCSinc(SDNode *N, SelectionDAG &DAG) {
2068820691
"Unexpected constant value");
2068920692

2069020693
SDValue NewNode = DAG.getNode(ISD::ADD, DL, VT, RHS, SDValue(CTVal, 0));
20691-
SDValue CCVal = DAG.getConstant(AArch64CC, DL, MVT::i32);
20694+
SDValue CCVal = getCondCode(DAG, AArch64CC);
2069220695
SDValue Cmp = LHS.getOperand(3);
2069320696

2069420697
return DAG.getNode(AArch64ISD::CSINC, DL, VT, NewNode, RHS, CCVal, Cmp);
@@ -20874,7 +20877,7 @@ static SDValue foldADCToCINC(SDNode *N, SelectionDAG &DAG) {
2087420877
SDLoc DL(N);
2087520878

2087620879
// (CINC x cc cond) <=> (CSINC x x !cc cond)
20877-
SDValue CC = DAG.getConstant(AArch64CC::LO, DL, MVT::i32);
20880+
SDValue CC = getCondCode(DAG, AArch64CC::LO);
2087820881
return DAG.getNode(AArch64ISD::CSINC, DL, VT, LHS, LHS, CC, Cond);
2087920882
}
2088020883

@@ -21947,7 +21950,7 @@ static SDValue getPTest(SelectionDAG &DAG, EVT VT, SDValue Pg, SDValue Op,
2194721950

2194821951
// Convert CC to integer based on requested condition.
2194921952
// NOTE: Cond is inverted to promote CSEL's removal when it feeds a compare.
21950-
SDValue CC = DAG.getConstant(getInvertedCondCode(Cond), DL, MVT::i32);
21953+
SDValue CC = getCondCode(DAG, getInvertedCondCode(Cond));
2195121954
SDValue Res = DAG.getNode(AArch64ISD::CSEL, DL, OutVT, FVal, TVal, CC, Test);
2195221955
return DAG.getZExtOrTrunc(Res, DL, VT);
2195321956
}
@@ -24931,10 +24934,9 @@ static SDValue performBRCONDCombine(SDNode *N,
2493124934
auto CSelCC = getCSETCondCode(CSel);
2493224935
if (CSelCC) {
2493324936
SDLoc DL(N);
24934-
return DAG.getNode(
24935-
N->getOpcode(), DL, N->getVTList(), Chain, Dest,
24936-
DAG.getConstant(getInvertedCondCode(*CSelCC), DL, MVT::i32),
24937-
CSel.getOperand(3));
24937+
return DAG.getNode(N->getOpcode(), DL, N->getVTList(), Chain, Dest,
24938+
getCondCode(DAG, getInvertedCondCode(*CSelCC)),
24939+
CSel.getOperand(3));
2493824940
}
2493924941
}
2494024942

@@ -25075,7 +25077,7 @@ static SDValue foldCSELOfCSEL(SDNode *Op, SelectionDAG &DAG) {
2507525077
SDLoc DL(Op);
2507625078
EVT VT = Op->getValueType(0);
2507725079

25078-
SDValue CCValue = DAG.getConstant(CC, DL, MVT::i32);
25080+
SDValue CCValue = getCondCode(DAG, CC);
2507925081
return DAG.getNode(AArch64ISD::CSEL, DL, VT, L, R, CCValue, Cond);
2508025082
}
2508125083

@@ -25152,8 +25154,7 @@ static SDValue reassociateCSELOperandsForCSE(SDNode *N, SelectionDAG &DAG) {
2515225154
SDValue TValReassoc = Reassociate(TReassocOp, 0);
2515325155
SDValue FValReassoc = Reassociate(FReassocOp, 1);
2515425156
return DAG.getNode(AArch64ISD::CSEL, SDLoc(N), VT, TValReassoc, FValReassoc,
25155-
DAG.getConstant(NewCC, SDLoc(N->getOperand(2)), MVT_CC),
25156-
NewCmp.getValue(1));
25157+
getCondCode(DAG, NewCC), NewCmp.getValue(1));
2515725158
};
2515825159

2515925160
auto CC = static_cast<AArch64CC::CondCode>(N->getConstantOperandVal(2));
@@ -25294,8 +25295,7 @@ static SDValue performCSELCombine(SDNode *N,
2529425295
SDValue Sub = DAG.getNode(AArch64ISD::SUBS, DL, Cond->getVTList(),
2529525296
Cond.getOperand(1), Cond.getOperand(0));
2529625297
return DAG.getNode(AArch64ISD::CSEL, DL, N->getVTList(), N->getOperand(0),
25297-
N->getOperand(1),
25298-
DAG.getConstant(NewCond, DL, MVT::i32),
25298+
N->getOperand(1), getCondCode(DAG, NewCond),
2529925299
Sub.getValue(1));
2530025300
}
2530125301
}
@@ -25395,10 +25395,9 @@ static SDValue performSETCCCombine(SDNode *N,
2539525395
auto NewCond = getInvertedCondCode(OldCond);
2539625396

2539725397
// csel 0, 1, !cond, X
25398-
SDValue CSEL =
25399-
DAG.getNode(AArch64ISD::CSEL, DL, LHS.getValueType(), LHS.getOperand(0),
25400-
LHS.getOperand(1), DAG.getConstant(NewCond, DL, MVT::i32),
25401-
LHS.getOperand(3));
25398+
SDValue CSEL = DAG.getNode(AArch64ISD::CSEL, DL, LHS.getValueType(),
25399+
LHS.getOperand(0), LHS.getOperand(1),
25400+
getCondCode(DAG, NewCond), LHS.getOperand(3));
2540225401
return DAG.getZExtOrTrunc(CSEL, DL, VT);
2540325402
}
2540425403

@@ -25468,8 +25467,7 @@ static SDValue performFlagSettingCombine(SDNode *N,
2546825467
// If the flag result isn't used, convert back to a generic opcode.
2546925468
if (!N->hasAnyUseOfValue(1)) {
2547025469
SDValue Res = DCI.DAG.getNode(GenericOpcode, DL, VT, N->ops());
25471-
return DCI.DAG.getMergeValues({Res, DCI.DAG.getConstant(0, DL, MVT::i32)},
25472-
DL);
25470+
return DCI.CombineTo(N, Res, SDValue(N, 1));
2547325471
}
2547425472

2547525473
// Combine identical generic nodes into this node, re-using the result.
@@ -27166,10 +27164,10 @@ SDValue AArch64TargetLowering::PerformDAGCombine(SDNode *N,
2716627164
SDValue A = DAG.getNode(
2716727165
AArch64ISD::MRS, DL, DAG.getVTList(MVT::i64, FlagsVT, MVT::Other),
2716827166
N->getOperand(0), DAG.getConstant(Register, DL, MVT::i32));
27169-
SDValue B = DAG.getNode(
27170-
AArch64ISD::CSINC, DL, MVT::i32, DAG.getConstant(0, DL, MVT::i32),
27171-
DAG.getConstant(0, DL, MVT::i32),
27172-
DAG.getConstant(AArch64CC::NE, DL, MVT::i32), A.getValue(1));
27167+
SDValue B = DAG.getNode(AArch64ISD::CSINC, DL, MVT::i32,
27168+
DAG.getConstant(0, DL, MVT::i32),
27169+
DAG.getConstant(0, DL, MVT::i32),
27170+
getCondCode(DAG, AArch64CC::NE), A.getValue(1));
2717327171
return DAG.getMergeValues(
2717427172
{A, DAG.getZExtOrTrunc(B, DL, MVT::i1), A.getValue(2)}, DL);
2717527173
}

0 commit comments

Comments
 (0)