diff options
author | Gaëtan Bossu <gaetan.bossu@arm.com> | 2025-07-31 13:07:28 +0000 |
---|---|---|
committer | Gaëtan Bossu <gaetan.bossu@arm.com> | 2025-08-01 09:23:30 +0000 |
commit | ebcb4929004ae3f08b2ca3d5d246f29aa73600e1 (patch) | |
tree | 29324702b4575e221c0efb710a6bf580059188e4 /llvm/lib/Target | |
parent | 73245b06b3da19ef70e04cf0f0a0d0df1ba82a57 (diff) | |
download | llvm-users/gbossu.vector.extract.1.zip llvm-users/gbossu.vector.extract.1.tar.gz llvm-users/gbossu.vector.extract.1.tar.bz2 |
[AArch64][ISel] Subvector extracts can use undef for second EXT inputusers/gbossu.vector.extract.1
This will later allow us to use the SVE2 constructive variant of EXT
without requiring a MOV. That is because that variant of EXT requires
two consecutive Z registers as input. As a consequence, extracting a
subvector from e.g. z2 into z0 would require:
z3 = MOV z2
z0 = EXT_ZZI_B { z2, z3 }, idx
With this change, the z3 part of the { z2, z3 } tuple will be marked as
undef, allowing the MOV to be simplified.
We just need to add patterns for EXT_ZZI_B now, currently only the the
destructive EXT_ZZI variant is selected.
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp index 7c9fc67..16f0229 100644 --- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -15544,7 +15544,9 @@ SDValue AArch64TargetLowering::LowerEXTRACT_SUBVECTOR(SDValue Op, assert(InVT.isScalableVector() && "Unexpected vector type!"); // Move requested subvector to the start of the vector and try again. - SDValue Splice = DAG.getNode(ISD::VECTOR_SPLICE, DL, InVT, Vec, Vec, Idx); + // There's no need for a second input to vector_splice, so use undef there. + SDValue Splice = + DAG.getNode(ISD::VECTOR_SPLICE, DL, InVT, Vec, DAG.getUNDEF(InVT), Idx); return convertFromScalableVector(DAG, VT, Splice); } |