@@ -1048,9 +1048,9 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
1048
1048
setTargetDAGCombine(ISD::INTRINSIC_WO_CHAIN);
1049
1049
1050
1050
setTargetDAGCombine({ISD::ANY_EXTEND, ISD::ZERO_EXTEND, ISD::SIGN_EXTEND,
1051
- ISD::VECTOR_SPLICE , ISD::SIGN_EXTEND_INREG ,
1052
- ISD::CONCAT_VECTORS , ISD::EXTRACT_SUBVECTOR ,
1053
- ISD::INSERT_SUBVECTOR, ISD:: STORE, ISD::BUILD_VECTOR});
1051
+ ISD::SIGN_EXTEND_INREG , ISD::CONCAT_VECTORS ,
1052
+ ISD::EXTRACT_SUBVECTOR , ISD::INSERT_SUBVECTOR ,
1053
+ ISD::STORE, ISD::BUILD_VECTOR});
1054
1054
setTargetDAGCombine(ISD::TRUNCATE);
1055
1055
setTargetDAGCombine(ISD::LOAD);
1056
1056
@@ -1580,6 +1580,7 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
1580
1580
setOperationAction(ISD::MLOAD, VT, Custom);
1581
1581
setOperationAction(ISD::INSERT_SUBVECTOR, VT, Custom);
1582
1582
setOperationAction(ISD::SPLAT_VECTOR, VT, Legal);
1583
+ setOperationAction(ISD::VECTOR_SPLICE, VT, Custom);
1583
1584
1584
1585
if (!Subtarget->isLittleEndian())
1585
1586
setOperationAction(ISD::BITCAST, VT, Expand);
@@ -10102,10 +10103,9 @@ SDValue AArch64TargetLowering::LowerVECTOR_SPLICE(SDValue Op,
10102
10103
Op.getOperand(1));
10103
10104
}
10104
10105
10105
- // This will select to an EXT instruction, which has a maximum immediate
10106
- // value of 255, hence 2048-bits is the maximum value we can lower.
10107
- if (IdxVal >= 0 &&
10108
- IdxVal < int64_t(2048 / Ty.getVectorElementType().getSizeInBits()))
10106
+ // We can select to an EXT instruction when indexing the first 256 bytes.
10107
+ unsigned BlockSize = AArch64::SVEBitsPerBlock / Ty.getVectorMinNumElements();
10108
+ if (IdxVal >= 0 && (IdxVal * BlockSize / 8) < 256)
10109
10109
return Op;
10110
10110
10111
10111
return SDValue();
@@ -24237,28 +24237,6 @@ performInsertVectorEltCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI) {
24237
24237
return performPostLD1Combine(N, DCI, true);
24238
24238
}
24239
24239
24240
- static SDValue performSVESpliceCombine(SDNode *N, SelectionDAG &DAG) {
24241
- EVT Ty = N->getValueType(0);
24242
- if (Ty.isInteger())
24243
- return SDValue();
24244
-
24245
- EVT IntTy = Ty.changeVectorElementTypeToInteger();
24246
- EVT ExtIntTy = getPackedSVEVectorVT(IntTy.getVectorElementCount());
24247
- if (ExtIntTy.getVectorElementType().getScalarSizeInBits() <
24248
- IntTy.getVectorElementType().getScalarSizeInBits())
24249
- return SDValue();
24250
-
24251
- SDLoc DL(N);
24252
- SDValue LHS = DAG.getAnyExtOrTrunc(DAG.getBitcast(IntTy, N->getOperand(0)),
24253
- DL, ExtIntTy);
24254
- SDValue RHS = DAG.getAnyExtOrTrunc(DAG.getBitcast(IntTy, N->getOperand(1)),
24255
- DL, ExtIntTy);
24256
- SDValue Idx = N->getOperand(2);
24257
- SDValue Splice = DAG.getNode(ISD::VECTOR_SPLICE, DL, ExtIntTy, LHS, RHS, Idx);
24258
- SDValue Trunc = DAG.getAnyExtOrTrunc(Splice, DL, IntTy);
24259
- return DAG.getBitcast(Ty, Trunc);
24260
- }
24261
-
24262
24240
static SDValue performFPExtendCombine(SDNode *N, SelectionDAG &DAG,
24263
24241
TargetLowering::DAGCombinerInfo &DCI,
24264
24242
const AArch64Subtarget *Subtarget) {
@@ -24643,8 +24621,6 @@ SDValue AArch64TargetLowering::PerformDAGCombine(SDNode *N,
24643
24621
case ISD::MGATHER:
24644
24622
case ISD::MSCATTER:
24645
24623
return performMaskedGatherScatterCombine(N, DCI, DAG);
24646
- case ISD::VECTOR_SPLICE:
24647
- return performSVESpliceCombine(N, DAG);
24648
24624
case ISD::FP_EXTEND:
24649
24625
return performFPExtendCombine(N, DAG, DCI, Subtarget);
24650
24626
case AArch64ISD::BRCOND:
0 commit comments