Skip to content

Commit b5c3203

Browse files
arsenmgithub-actions[bot]
authored andcommitted
Automerge: AArch64: Use TargetConstant for intrinsic IDs (#166661)
These should always use TargetConstant
2 parents d69cba4 + bbf62dc commit b5c3203

File tree

1 file changed

+47
-41
lines changed

1 file changed

+47
-41
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 47 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5555,9 +5555,10 @@ SDValue AArch64TargetLowering::LowerGET_ROUNDING(SDValue Op,
55555555
SDLoc DL(Op);
55565556

55575557
SDValue Chain = Op.getOperand(0);
5558-
SDValue FPCR_64 = DAG.getNode(
5559-
ISD::INTRINSIC_W_CHAIN, DL, {MVT::i64, MVT::Other},
5560-
{Chain, DAG.getConstant(Intrinsic::aarch64_get_fpcr, DL, MVT::i64)});
5558+
SDValue FPCR_64 =
5559+
DAG.getNode(ISD::INTRINSIC_W_CHAIN, DL, {MVT::i64, MVT::Other},
5560+
{Chain, DAG.getTargetConstant(Intrinsic::aarch64_get_fpcr, DL,
5561+
MVT::i64)});
55615562
Chain = FPCR_64.getValue(1);
55625563
SDValue FPCR_32 = DAG.getNode(ISD::TRUNCATE, DL, MVT::i32, FPCR_64);
55635564
SDValue FltRounds = DAG.getNode(ISD::ADD, DL, MVT::i32, FPCR_32,
@@ -5643,7 +5644,8 @@ SDValue AArch64TargetLowering::LowerSET_FPMODE(SDValue Op,
56435644

56445645
// Set new value of FPCR.
56455646
SDValue Ops2[] = {
5646-
Chain, DAG.getConstant(Intrinsic::aarch64_set_fpcr, DL, MVT::i64), FPCR};
5647+
Chain, DAG.getTargetConstant(Intrinsic::aarch64_set_fpcr, DL, MVT::i64),
5648+
FPCR};
56475649
return DAG.getNode(ISD::INTRINSIC_VOID, DL, MVT::Other, Ops2);
56485650
}
56495651

@@ -5666,9 +5668,9 @@ SDValue AArch64TargetLowering::LowerRESET_FPMODE(SDValue Op,
56665668
DAG.getConstant(AArch64::ReservedFPControlBits, DL, MVT::i64));
56675669

56685670
// Set new value of FPCR.
5669-
SDValue Ops2[] = {Chain,
5670-
DAG.getConstant(Intrinsic::aarch64_set_fpcr, DL, MVT::i64),
5671-
FPSCRMasked};
5671+
SDValue Ops2[] = {
5672+
Chain, DAG.getTargetConstant(Intrinsic::aarch64_set_fpcr, DL, MVT::i64),
5673+
FPSCRMasked};
56725674
return DAG.getNode(ISD::INTRINSIC_VOID, DL, MVT::Other, Ops2);
56735675
}
56745676

@@ -7300,17 +7302,19 @@ SDValue AArch64TargetLowering::LowerVECTOR_COMPRESS(SDValue Op,
73007302

73017303
SDValue Compressed = DAG.getNode(
73027304
ISD::INTRINSIC_WO_CHAIN, DL, Vec.getValueType(),
7303-
DAG.getConstant(Intrinsic::aarch64_sve_compact, DL, MVT::i64), Mask, Vec);
7305+
DAG.getTargetConstant(Intrinsic::aarch64_sve_compact, DL, MVT::i64), Mask,
7306+
Vec);
73047307

73057308
// compact fills with 0s, so if our passthru is all 0s, do nothing here.
73067309
if (HasPassthru && !ISD::isConstantSplatVectorAllZeros(Passthru.getNode())) {
73077310
SDValue Offset = DAG.getNode(
73087311
ISD::INTRINSIC_WO_CHAIN, DL, MVT::i64,
7309-
DAG.getConstant(Intrinsic::aarch64_sve_cntp, DL, MVT::i64), Mask, Mask);
7312+
DAG.getTargetConstant(Intrinsic::aarch64_sve_cntp, DL, MVT::i64), Mask,
7313+
Mask);
73107314

73117315
SDValue IndexMask = DAG.getNode(
73127316
ISD::INTRINSIC_WO_CHAIN, DL, MaskVT,
7313-
DAG.getConstant(Intrinsic::aarch64_sve_whilelo, DL, MVT::i64),
7317+
DAG.getTargetConstant(Intrinsic::aarch64_sve_whilelo, DL, MVT::i64),
73147318
DAG.getConstant(0, DL, MVT::i64), Offset);
73157319

73167320
Compressed =
@@ -7439,10 +7443,10 @@ static SDValue LowerFLDEXP(SDValue Op, SelectionDAG &DAG) {
74397443
DAG.getUNDEF(ExpVT), Exp, Zero);
74407444
SDValue VPg = getPTrue(DAG, DL, XVT.changeVectorElementType(MVT::i1),
74417445
AArch64SVEPredPattern::all);
7442-
SDValue FScale =
7443-
DAG.getNode(ISD::INTRINSIC_WO_CHAIN, DL, XVT,
7444-
DAG.getConstant(Intrinsic::aarch64_sve_fscale, DL, MVT::i64),
7445-
VPg, VX, VExp);
7446+
SDValue FScale = DAG.getNode(
7447+
ISD::INTRINSIC_WO_CHAIN, DL, XVT,
7448+
DAG.getTargetConstant(Intrinsic::aarch64_sve_fscale, DL, MVT::i64), VPg,
7449+
VX, VExp);
74467450
SDValue Final =
74477451
DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL, X.getValueType(), FScale, Zero);
74487452
if (X.getValueType() != XScalarTy)
@@ -8106,7 +8110,7 @@ static SDValue emitRestoreZALazySave(SDValue Chain, SDLoc DL,
81068110
TLI.getLibcallName(LC), TLI.getPointerTy(DAG.getDataLayout()));
81078111
SDValue TPIDR2_EL0 = DAG.getNode(
81088112
ISD::INTRINSIC_W_CHAIN, DL, MVT::i64, Chain,
8109-
DAG.getConstant(Intrinsic::aarch64_sme_get_tpidr2, DL, MVT::i32));
8113+
DAG.getTargetConstant(Intrinsic::aarch64_sme_get_tpidr2, DL, MVT::i32));
81108114
// Copy the address of the TPIDR2 block into X0 before 'calling' the
81118115
// RESTORE_ZA pseudo.
81128116
SDValue Glue;
@@ -8121,7 +8125,7 @@ static SDValue emitRestoreZALazySave(SDValue Chain, SDLoc DL,
81218125
// Finally reset the TPIDR2_EL0 register to 0.
81228126
Chain = DAG.getNode(
81238127
ISD::INTRINSIC_VOID, DL, MVT::Other, Chain,
8124-
DAG.getConstant(Intrinsic::aarch64_sme_set_tpidr2, DL, MVT::i32),
8128+
DAG.getTargetConstant(Intrinsic::aarch64_sme_set_tpidr2, DL, MVT::i32),
81258129
DAG.getConstant(0, DL, MVT::i64));
81268130
TPIDR2.Uses++;
81278131
return Chain;
@@ -8716,7 +8720,7 @@ SDValue AArch64TargetLowering::LowerFormalArguments(
87168720
if (Attrs.isNewZT0())
87178721
Chain = DAG.getNode(
87188722
ISD::INTRINSIC_VOID, DL, MVT::Other, Chain,
8719-
DAG.getConstant(Intrinsic::aarch64_sme_zero_zt, DL, MVT::i32),
8723+
DAG.getTargetConstant(Intrinsic::aarch64_sme_zero_zt, DL, MVT::i32),
87208724
DAG.getTargetConstant(0, DL, MVT::i32));
87218725
}
87228726

@@ -9529,7 +9533,7 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
95299533
DAG.getTargetLoweringInfo().getFrameIndexTy(DAG.getDataLayout()));
95309534
Chain = DAG.getNode(
95319535
ISD::INTRINSIC_VOID, DL, MVT::Other, Chain,
9532-
DAG.getConstant(Intrinsic::aarch64_sme_set_tpidr2, DL, MVT::i32),
9536+
DAG.getTargetConstant(Intrinsic::aarch64_sme_set_tpidr2, DL, MVT::i32),
95339537
TPIDR2ObjAddr);
95349538
OptimizationRemarkEmitter ORE(&MF.getFunction());
95359539
ORE.emit([&]() {
@@ -13421,8 +13425,8 @@ SDValue ReconstructShuffleWithRuntimeMask(SDValue Op, SelectionDAG &DAG) {
1342113425

1342213426
return DAG.getNode(
1342313427
ISD::INTRINSIC_WO_CHAIN, DL, VT,
13424-
DAG.getConstant(Intrinsic::aarch64_neon_tbl1, DL, MVT::i32), SourceVec,
13425-
MaskSourceVec);
13428+
DAG.getTargetConstant(Intrinsic::aarch64_neon_tbl1, DL, MVT::i32),
13429+
SourceVec, MaskSourceVec);
1342613430
}
1342713431

1342813432
// Gather data to see if the operation can be modelled as a
@@ -14278,14 +14282,16 @@ static SDValue GenerateTBL(SDValue Op, ArrayRef<int> ShuffleMask,
1427814282
V1Cst = DAG.getNode(ISD::CONCAT_VECTORS, DL, MVT::v16i8, V1Cst, V1Cst);
1427914283
Shuffle = DAG.getNode(
1428014284
ISD::INTRINSIC_WO_CHAIN, DL, IndexVT,
14281-
DAG.getConstant(Intrinsic::aarch64_neon_tbl1, DL, MVT::i32), V1Cst,
14285+
DAG.getTargetConstant(Intrinsic::aarch64_neon_tbl1, DL, MVT::i32),
14286+
V1Cst,
1428214287
DAG.getBuildVector(IndexVT, DL, ArrayRef(TBLMask.data(), IndexLen)));
1428314288
} else {
1428414289
if (IndexLen == 8) {
1428514290
V1Cst = DAG.getNode(ISD::CONCAT_VECTORS, DL, MVT::v16i8, V1Cst, V2Cst);
1428614291
Shuffle = DAG.getNode(
1428714292
ISD::INTRINSIC_WO_CHAIN, DL, IndexVT,
14288-
DAG.getConstant(Intrinsic::aarch64_neon_tbl1, DL, MVT::i32), V1Cst,
14293+
DAG.getTargetConstant(Intrinsic::aarch64_neon_tbl1, DL, MVT::i32),
14294+
V1Cst,
1428914295
DAG.getBuildVector(IndexVT, DL, ArrayRef(TBLMask.data(), IndexLen)));
1429014296
} else {
1429114297
// FIXME: We cannot, for the moment, emit a TBL2 instruction because we
@@ -14296,8 +14302,8 @@ static SDValue GenerateTBL(SDValue Op, ArrayRef<int> ShuffleMask,
1429614302
// IndexLen));
1429714303
Shuffle = DAG.getNode(
1429814304
ISD::INTRINSIC_WO_CHAIN, DL, IndexVT,
14299-
DAG.getConstant(Intrinsic::aarch64_neon_tbl2, DL, MVT::i32), V1Cst,
14300-
V2Cst,
14305+
DAG.getTargetConstant(Intrinsic::aarch64_neon_tbl2, DL, MVT::i32),
14306+
V1Cst, V2Cst,
1430114307
DAG.getBuildVector(IndexVT, DL, ArrayRef(TBLMask.data(), IndexLen)));
1430214308
}
1430314309
}
@@ -16450,10 +16456,10 @@ SDValue AArch64TargetLowering::LowerVectorSRA_SRL_SHL(SDValue Op,
1645016456
if (isVShiftLImm(Op.getOperand(1), VT, false, Cnt) && Cnt < EltSize)
1645116457
return DAG.getNode(AArch64ISD::VSHL, DL, VT, Op.getOperand(0),
1645216458
DAG.getTargetConstant(Cnt, DL, MVT::i32));
16453-
return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, DL, VT,
16454-
DAG.getConstant(Intrinsic::aarch64_neon_ushl, DL,
16455-
MVT::i32),
16456-
Op.getOperand(0), Op.getOperand(1));
16459+
return DAG.getNode(
16460+
ISD::INTRINSIC_WO_CHAIN, DL, VT,
16461+
DAG.getTargetConstant(Intrinsic::aarch64_neon_ushl, DL, MVT::i32),
16462+
Op.getOperand(0), Op.getOperand(1));
1645716463
case ISD::SRA:
1645816464
case ISD::SRL:
1645916465
if (VT.isScalableVector() &&
@@ -20049,7 +20055,7 @@ static SDValue performFpToIntCombine(SDNode *N, SelectionDAG &DAG,
2004920055
: Intrinsic::aarch64_neon_vcvtfp2fxu;
2005020056
SDValue FixConv =
2005120057
DAG.getNode(ISD::INTRINSIC_WO_CHAIN, DL, ResTy,
20052-
DAG.getConstant(IntrinsicOpcode, DL, MVT::i32),
20058+
DAG.getTargetConstant(IntrinsicOpcode, DL, MVT::i32),
2005320059
Op->getOperand(0), DAG.getTargetConstant(C, DL, MVT::i32));
2005420060
// We can handle smaller integers by generating an extra trunc.
2005520061
if (IntBits < FloatBits)
@@ -27338,8 +27344,8 @@ static SDValue combineSVEPrefetchVecBaseImmOff(SDNode *N, SelectionDAG &DAG,
2733827344
// ...and remap the intrinsic `aarch64_sve_prf<T>_gather_scalar_offset` to
2733927345
// `aarch64_sve_prfb_gather_uxtw_index`.
2734027346
SDLoc DL(N);
27341-
Ops[1] = DAG.getConstant(Intrinsic::aarch64_sve_prfb_gather_uxtw_index, DL,
27342-
MVT::i64);
27347+
Ops[1] = DAG.getTargetConstant(Intrinsic::aarch64_sve_prfb_gather_uxtw_index,
27348+
DL, MVT::i64);
2734327349

2734427350
return DAG.getNode(N->getOpcode(), DL, DAG.getVTList(MVT::Other), Ops);
2734527351
}
@@ -31204,10 +31210,10 @@ static SDValue GenerateFixedLengthSVETBL(SDValue Op, SDValue Op1, SDValue Op2,
3120431210

3120531211
SDValue Shuffle;
3120631212
if (IsSingleOp)
31207-
Shuffle =
31208-
DAG.getNode(ISD::INTRINSIC_WO_CHAIN, DL, ContainerVT,
31209-
DAG.getConstant(Intrinsic::aarch64_sve_tbl, DL, MVT::i32),
31210-
Op1, SVEMask);
31213+
Shuffle = DAG.getNode(
31214+
ISD::INTRINSIC_WO_CHAIN, DL, ContainerVT,
31215+
DAG.getTargetConstant(Intrinsic::aarch64_sve_tbl, DL, MVT::i32), Op1,
31216+
SVEMask);
3121131217
else if (Subtarget.hasSVE2()) {
3121231218
if (!MinMaxEqual) {
3121331219
unsigned MinNumElts = AArch64::SVEBitsPerBlock / BitsPerElt;
@@ -31226,10 +31232,10 @@ static SDValue GenerateFixedLengthSVETBL(SDValue Op, SDValue Op1, SDValue Op2,
3122631232
SVEMask = convertToScalableVector(
3122731233
DAG, getContainerForFixedLengthVector(DAG, MaskType), UpdatedVecMask);
3122831234
}
31229-
Shuffle =
31230-
DAG.getNode(ISD::INTRINSIC_WO_CHAIN, DL, ContainerVT,
31231-
DAG.getConstant(Intrinsic::aarch64_sve_tbl2, DL, MVT::i32),
31232-
Op1, Op2, SVEMask);
31235+
Shuffle = DAG.getNode(
31236+
ISD::INTRINSIC_WO_CHAIN, DL, ContainerVT,
31237+
DAG.getTargetConstant(Intrinsic::aarch64_sve_tbl2, DL, MVT::i32), Op1,
31238+
Op2, SVEMask);
3123331239
}
3123431240
Shuffle = convertFromScalableVector(DAG, VT, Shuffle);
3123531241
return DAG.getNode(ISD::BITCAST, DL, Op.getValueType(), Shuffle);
@@ -31389,8 +31395,8 @@ SDValue AArch64TargetLowering::LowerFixedLengthVECTOR_SHUFFLEToSVE(
3138931395
unsigned SegmentElts = VT.getVectorNumElements() / Segments;
3139031396
if (std::optional<unsigned> Lane =
3139131397
isDUPQMask(ShuffleMask, Segments, SegmentElts)) {
31392-
SDValue IID =
31393-
DAG.getConstant(Intrinsic::aarch64_sve_dup_laneq, DL, MVT::i64);
31398+
SDValue IID = DAG.getTargetConstant(Intrinsic::aarch64_sve_dup_laneq,
31399+
DL, MVT::i64);
3139431400
return convertFromScalableVector(
3139531401
DAG, VT,
3139631402
DAG.getNode(ISD::INTRINSIC_WO_CHAIN, DL, ContainerVT,

0 commit comments

Comments
 (0)