1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc < %s | FileCheck %s
4 target triple = "aarch64-unknown-linux-gnu"
6 %my_subtype = type <vscale x 2 x double>
7 %my_type = type [3 x %my_subtype]
9 define void @array_1D(ptr %addr) #0 {
10 ; CHECK-LABEL: array_1D:
11 ; CHECK: // %bb.0: // %entry
12 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
13 ; CHECK-NEXT: addvl sp, sp, #-3
14 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0c, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0x18, 0x92, 0x2e, 0x00, 0x1e, 0x22 // sp + 16 + 24 * VG
15 ; CHECK-NEXT: .cfi_offset w29, -16
16 ; CHECK-NEXT: ptrue p0.d
17 ; CHECK-NEXT: ld1d { z0.d }, p0/z, [x0, #1, mul vl]
18 ; CHECK-NEXT: ld1d { z1.d }, p0/z, [x0, #2, mul vl]
19 ; CHECK-NEXT: ld1d { z2.d }, p0/z, [x0]
20 ; CHECK-NEXT: st1d { z2.d }, p0, [sp]
21 ; CHECK-NEXT: st1d { z1.d }, p0, [sp, #2, mul vl]
22 ; CHECK-NEXT: st1d { z0.d }, p0, [sp, #1, mul vl]
23 ; CHECK-NEXT: addvl sp, sp, #3
24 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
27 %ret = alloca %my_type, align 8
28 %val = load %my_type, ptr %addr
29 store %my_type %val, ptr %ret, align 8
33 define %my_subtype @array_1D_extract(ptr %addr) #0 {
34 ; CHECK-LABEL: array_1D_extract:
35 ; CHECK: // %bb.0: // %entry
36 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
37 ; CHECK-NEXT: addvl sp, sp, #-3
38 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0c, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0x18, 0x92, 0x2e, 0x00, 0x1e, 0x22 // sp + 16 + 24 * VG
39 ; CHECK-NEXT: .cfi_offset w29, -16
40 ; CHECK-NEXT: ptrue p0.d
41 ; CHECK-NEXT: ld1d { z0.d }, p0/z, [x0, #1, mul vl]
42 ; CHECK-NEXT: addvl sp, sp, #3
43 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
46 %ret = alloca %my_type, align 8
47 %val = load %my_type, ptr %addr
48 %elt = extractvalue %my_type %val, 1
52 define void @array_1D_insert(ptr %addr, %my_subtype %elt) #0 {
53 ; CHECK-LABEL: array_1D_insert:
54 ; CHECK: // %bb.0: // %entry
55 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
56 ; CHECK-NEXT: addvl sp, sp, #-3
57 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0c, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0x18, 0x92, 0x2e, 0x00, 0x1e, 0x22 // sp + 16 + 24 * VG
58 ; CHECK-NEXT: .cfi_offset w29, -16
59 ; CHECK-NEXT: ptrue p0.d
60 ; CHECK-NEXT: ld1d { z1.d }, p0/z, [x0]
61 ; CHECK-NEXT: ld1d { z2.d }, p0/z, [x0, #2, mul vl]
62 ; CHECK-NEXT: st1d { z2.d }, p0, [sp, #2, mul vl]
63 ; CHECK-NEXT: st1d { z1.d }, p0, [sp]
64 ; CHECK-NEXT: st1d { z0.d }, p0, [sp, #1, mul vl]
65 ; CHECK-NEXT: addvl sp, sp, #3
66 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
69 %ret = alloca %my_type, align 8
70 %val = load %my_type, ptr %addr
71 %ins = insertvalue %my_type %val, %my_subtype %elt, 1
72 store %my_type %ins, ptr %ret, align 8
76 define void @array_2D(ptr %addr) #0 {
77 ; CHECK-LABEL: array_2D:
78 ; CHECK: // %bb.0: // %entry
79 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
80 ; CHECK-NEXT: addvl sp, sp, #-6
81 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0c, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0x30, 0x92, 0x2e, 0x00, 0x1e, 0x22 // sp + 16 + 48 * VG
82 ; CHECK-NEXT: .cfi_offset w29, -16
83 ; CHECK-NEXT: ptrue p0.d
84 ; CHECK-NEXT: ld1d { z0.d }, p0/z, [x0, #1, mul vl]
85 ; CHECK-NEXT: ld1d { z1.d }, p0/z, [x0, #2, mul vl]
86 ; CHECK-NEXT: ld1d { z2.d }, p0/z, [x0, #3, mul vl]
87 ; CHECK-NEXT: ld1d { z3.d }, p0/z, [x0, #4, mul vl]
88 ; CHECK-NEXT: ld1d { z4.d }, p0/z, [x0, #5, mul vl]
89 ; CHECK-NEXT: ld1d { z5.d }, p0/z, [x0]
90 ; CHECK-NEXT: st1d { z5.d }, p0, [sp]
91 ; CHECK-NEXT: st1d { z4.d }, p0, [sp, #5, mul vl]
92 ; CHECK-NEXT: st1d { z3.d }, p0, [sp, #4, mul vl]
93 ; CHECK-NEXT: st1d { z2.d }, p0, [sp, #3, mul vl]
94 ; CHECK-NEXT: st1d { z1.d }, p0, [sp, #2, mul vl]
95 ; CHECK-NEXT: st1d { z0.d }, p0, [sp, #1, mul vl]
96 ; CHECK-NEXT: addvl sp, sp, #6
97 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
100 %ret = alloca [2 x %my_type], align 8
101 %val = load [2 x %my_type], ptr %addr
102 store [2 x %my_type] %val, ptr %ret, align 8
106 attributes #0 = { "target-features"="+sve" }