[PATCH] D103170: [CodeGen][AArch64][SVE] Use ld1r[bhsd] for vector splat from memory
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 1 14:08:52 PDT 2021
efriedma added a comment.
In D103170#2852580 <https://reviews.llvm.org/D103170#2852580>, @peterwaller-arm wrote:
> In D103170#2808815 <https://reviews.llvm.org/D103170#2808815>, @efriedma wrote:
>
>> Maybe add a testcase for splat of a constant? Not sure what the code generation should look like, but it would be good to have coverage.
>
> @efriedma I wasn't sure why you might be after for splat-of-constant, since this is about reading from memory. Are you thinking of splat-of-constant where the constant is out of range for an immediate? Something like https://github.com/llvm/llvm-project/blob/0596f7d828436e7db85154f2815eb3ff32d505af/llvm/test/CodeGen/AArch64/sve-intrinsics-dup-x.ll ? Or something else? Thanks for your review!
Yes, an splat with an out-of-range immediate. We generate a load for some floating-point constants. For example:
define <vscale x 2 x double> @z() {
%1 = insertelement <vscale x 2 x double> undef, double 3.33, i32 0
%2 = shufflevector <vscale x 2 x double> %1, <vscale x 2 x double> undef, <vscale x 2 x i32> zeroinitializer
ret <vscale x 2 x double> %2
}
Currently lowers to:
adrp x8, .LCPI0_0
ldr d0, [x8, :lo12:.LCPI0_0]
mov z0.d, d0
ret
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103170/new/
https://reviews.llvm.org/D103170
More information about the llvm-commits
mailing list