[AArch64][SVE] Use SIMD variant of INSR when scalar is the result of a vector extract
authorBradley Smith <bradley.smith@arm.com>
Fri, 23 Apr 2021 15:34:26 +0000 (16:34 +0100)
committerBradley Smith <bradley.smith@arm.com>
Thu, 29 Apr 2021 11:17:42 +0000 (12:17 +0100)
commit354604a2a7149b5efd52134efa4765cf8c32e386
treebfb879ff62c9dc0141272e1a3575407f4dca01ea
parent89085bcc86d4dad5cac1601f3c54b776e53eeaa4
[AArch64][SVE] Use SIMD variant of INSR when scalar is the result of a vector extract

At the intrinsic layer the sve.insr operation takes a scalar. When this
scalar is an integer we are forcing a data transition between GPRs and
ZPRs that is potentially costly.

Often the integer scalar is the result of a vector extract, when
performing a reduction for example. In such cases we should keep all
data within the ZPRs.

Co-authored-by: Paul Walker <paul.walker@arm.com>
Differential Revision: https://reviews.llvm.org/D101169
llvm/lib/Target/AArch64/SVEInstrFormats.td
llvm/test/CodeGen/AArch64/sve-insr.ll [new file with mode: 0644]