Skip to content

Commit cb5cc47

Browse files
[SVE] Lower fixed length vector ISD::SPLAT_VECTOR operations.
Also strengthens the CHECK lines for scalable vector splat tests. Differential Revision: https://reviews.llvm.org/D86070
1 parent d2057a8 commit cb5cc47

File tree

4 files changed

+674
-8
lines changed

4 files changed

+674
-8
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,7 @@ void AArch64TargetLowering::addTypeForFixedLengthSVE(MVT VT) {
11241124
setOperationAction(ISD::SIGN_EXTEND_INREG, VT, Custom);
11251125
setOperationAction(ISD::SMAX, VT, Custom);
11261126
setOperationAction(ISD::SMIN, VT, Custom);
1127+
setOperationAction(ISD::SPLAT_VECTOR, VT, Custom);
11271128
setOperationAction(ISD::SRA, VT, Custom);
11281129
setOperationAction(ISD::SRL, VT, Custom);
11291130
setOperationAction(ISD::STORE, VT, Custom);
@@ -7978,9 +7979,11 @@ SDValue AArch64TargetLowering::LowerSPLAT_VECTOR(SDValue Op,
79787979
SDLoc dl(Op);
79797980
EVT VT = Op.getValueType();
79807981
EVT ElemVT = VT.getScalarType();
7981-
79827982
SDValue SplatVal = Op.getOperand(0);
79837983

7984+
if (useSVEForFixedLengthVectorVT(VT))
7985+
return LowerToScalableOp(Op, DAG);
7986+
79847987
// Extend input splat value where needed to fit into a GPR (32b or 64b only)
79857988
// FPRs don't have this restriction.
79867989
switch (ElemVT.getSimpleVT().SimpleTy) {
@@ -15485,6 +15488,15 @@ SDValue AArch64TargetLowering::LowerToScalableOp(SDValue Op,
1548515488
// Create list of operands by converting existing ones to scalable types.
1548615489
SmallVector<SDValue, 4> Ops;
1548715490
for (const SDValue &V : Op->op_values()) {
15491+
assert(!isa<VTSDNode>(V) && "Unexpected VTSDNode node!");
15492+
15493+
// Pass through non-vector operands.
15494+
if (!V.getValueType().isVector()) {
15495+
Ops.push_back(V);
15496+
continue;
15497+
}
15498+
15499+
// "cast" fixed length vector to a scalable vector.
1548815500
assert(useSVEForFixedLengthVectorVT(V.getValueType()) &&
1548915501
"Only fixed length vectors are supported!");
1549015502
Ops.push_back(convertToScalableVector(DAG, ContainerVT, V));

0 commit comments

Comments
 (0)