File: sve-ldstnt1.mir

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (219 lines) | stat: -rw-r--r-- 13,866 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve -run-pass=prologepilog -simplify-mir -verify-machineinstrs %s -o - | FileCheck %s
#
# Test that prologepilog works for each of the LDNT1/STNT1 instructions for stack-based objects.
#
--- |
  define void @testcase_positive_offset() uwtable {
    %dummy = alloca <vscale x 2 x i64>, align 8
    %object = alloca <vscale x 2 x i64>, align 8
    ; Reads from %object at offset 7 * readsize
    ret void
  }
  define void @testcase_negative_offset() uwtable {
    %dummy = alloca <vscale x 2 x i64>, align 8
    %object = alloca <vscale x 2 x i64>, align 8
    ; Reads from %object at offset -8 * readsize
    ret void
  }

  define void @testcase_positive_offset_out_of_range() uwtable {
    %dummy = alloca <vscale x 2 x i64>, align 8
    %object = alloca <vscale x 2 x i64>, align 8
    ; Reads from %object at offset 8 * readsize
    ret void
  }
  define void @testcase_negative_offset_out_of_range() uwtable {
    %dummy = alloca <vscale x 2 x i64>, align 8
    %object = alloca <vscale x 2 x i64>, align 8
    ; Reads from %object at offset -9 * readsize
    ret void
  }
...
---
name:            testcase_positive_offset
tracksRegLiveness: true
stack:
  - { id: 0, name: dummy, type: default, offset: 0, size: 32, alignment: 16, stack-id: scalable-vector }
  - { id: 1, name: object, type: default, offset: 0, size: 32, alignment: 16, stack-id: scalable-vector }
body:             |
  bb.0 (%ir-block.0):
    liveins: $p0

    ; CHECK-LABEL: name: testcase_positive_offset
    ; CHECK: liveins: $p0
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: early-clobber $sp = frame-setup STRXpre killed $fp, $sp, -16 :: (store (s64) into %stack.2)
    ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
    ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $w29, -16
    ; CHECK-NEXT: $sp = frame-setup ADDVL_XXI $sp, -4
    ; CHECK-NEXT: frame-setup CFI_INSTRUCTION escape 0x0f, 0x0c, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0x20, 0x92, 0x2e, 0x00, 0x1e, 0x22
    ; CHECK-NEXT: renamable $z0 = LDNT1B_ZRI renamable $p0, $sp, 7 :: (load (s8) from %ir.object, align 2)
    ; CHECK-NEXT: renamable $z0 = LDNT1H_ZRI renamable $p0, $sp, 7 :: (load (s16) from %ir.object)
    ; CHECK-NEXT: renamable $z0 = LDNT1W_ZRI renamable $p0, $sp, 7 :: (load (s32) from %ir.object, align 8)
    ; CHECK-NEXT: renamable $z0 = LDNT1D_ZRI renamable $p0, $sp, 7 :: (load (s64) from %ir.object)
    ; CHECK-NEXT: STNT1B_ZRI renamable $z0, renamable $p0, $sp, 7 :: (store (s8) into %ir.object, align 8)
    ; CHECK-NEXT: STNT1H_ZRI renamable $z0, renamable $p0, $sp, 7 :: (store (s16) into %ir.object, align 8)
    ; CHECK-NEXT: STNT1W_ZRI renamable $z0, renamable $p0, $sp, 7 :: (store (s32) into %ir.object, align 8)
    ; CHECK-NEXT: STNT1D_ZRI renamable $z0, renamable $p0, $sp, 7 :: (store (s64) into %ir.object)
    ; CHECK-NEXT: $sp = frame-destroy ADDVL_XXI $sp, 4
    ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION def_cfa $wsp, 16
    ; CHECK-NEXT: early-clobber $sp, $fp = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.2)
    ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION def_cfa_offset 0
    ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION restore $w29
    ; CHECK-NEXT: RET_ReallyLR implicit $z0
    renamable $z0 = LDNT1B_ZRI renamable $p0, %stack.1.object, 7 :: (load 1 from %ir.object, align 2)
    renamable $z0 = LDNT1H_ZRI renamable $p0, %stack.1.object, 7 :: (load 2 from %ir.object, align 2)
    renamable $z0 = LDNT1W_ZRI renamable $p0, %stack.1.object, 7 :: (load 4 from %ir.object, align 8)
    renamable $z0 = LDNT1D_ZRI renamable $p0, %stack.1.object, 7 :: (load 8 from %ir.object, align 8)
    STNT1B_ZRI renamable $z0, renamable $p0, %stack.1.object, 7 :: (store 1 into %ir.object, align 8)
    STNT1H_ZRI renamable $z0, renamable $p0, %stack.1.object, 7 :: (store 2 into %ir.object, align 8)
    STNT1W_ZRI renamable $z0, renamable $p0, %stack.1.object, 7 :: (store 4 into %ir.object, align 8)
    STNT1D_ZRI renamable $z0, renamable $p0, %stack.1.object, 7 :: (store 8 into %ir.object, align 8)
    RET_ReallyLR implicit $z0
...

---
name:            testcase_negative_offset
tracksRegLiveness: true
stack:
  - { id: 0, name: dummy, type: default, offset: 0, size: 32, alignment: 16, stack-id: scalable-vector }
  - { id: 1, name: object, type: default, offset: 0, size: 32, alignment: 16, stack-id: scalable-vector }
body:             |
  bb.0 (%ir-block.0):
    liveins: $p0

    ; CHECK-LABEL: name: testcase_negative_offset
    ; CHECK: liveins: $p0
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: early-clobber $sp = frame-setup STRXpre killed $fp, $sp, -16 :: (store (s64) into %stack.2)
    ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
    ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $w29, -16
    ; CHECK-NEXT: $sp = frame-setup ADDVL_XXI $sp, -4
    ; CHECK-NEXT: frame-setup CFI_INSTRUCTION escape 0x0f, 0x0c, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0x20, 0x92, 0x2e, 0x00, 0x1e, 0x22
    ; CHECK-NEXT: renamable $z0 = LDNT1B_ZRI renamable $p0, $sp, -8 :: (load (s8) from %ir.object, align 2)
    ; CHECK-NEXT: renamable $z0 = LDNT1H_ZRI renamable $p0, $sp, -8 :: (load (s16) from %ir.object)
    ; CHECK-NEXT: renamable $z0 = LDNT1W_ZRI renamable $p0, $sp, -8 :: (load (s32) from %ir.object)
    ; CHECK-NEXT: renamable $z0 = LDNT1D_ZRI renamable $p0, $sp, -8 :: (load (s64) from %ir.object)
    ; CHECK-NEXT: STNT1B_ZRI renamable $z0, renamable $p0, $sp, -8 :: (store (s8) into %ir.object, align 8)
    ; CHECK-NEXT: STNT1H_ZRI renamable $z0, renamable $p0, $sp, -8 :: (store (s16) into %ir.object, align 8)
    ; CHECK-NEXT: STNT1W_ZRI renamable $z0, renamable $p0, $sp, -8 :: (store (s32) into %ir.object, align 8)
    ; CHECK-NEXT: STNT1D_ZRI renamable $z0, renamable $p0, $sp, -8 :: (store (s64) into %ir.object)
    ; CHECK-NEXT: $sp = frame-destroy ADDVL_XXI $sp, 4
    ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION def_cfa $wsp, 16
    ; CHECK-NEXT: early-clobber $sp, $fp = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.2)
    ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION def_cfa_offset 0
    ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION restore $w29
    ; CHECK-NEXT: RET_ReallyLR implicit $z0
    renamable $z0 = LDNT1B_ZRI renamable $p0, %stack.1.object, -8 :: (load 1 from %ir.object, align 2)
    renamable $z0 = LDNT1H_ZRI renamable $p0, %stack.1.object, -8 :: (load 2 from %ir.object, align 2)
    renamable $z0 = LDNT1W_ZRI renamable $p0, %stack.1.object, -8 :: (load 4 from %ir.object, align 4)
    renamable $z0 = LDNT1D_ZRI renamable $p0, %stack.1.object, -8 :: (load 8 from %ir.object, align 8)
    STNT1B_ZRI renamable $z0, renamable $p0, %stack.1.object, -8 :: (store 1 into %ir.object, align 8)
    STNT1H_ZRI renamable $z0, renamable $p0, %stack.1.object, -8 :: (store 2 into %ir.object, align 8)
    STNT1W_ZRI renamable $z0, renamable $p0, %stack.1.object, -8 :: (store 4 into %ir.object, align 8)
    STNT1D_ZRI renamable $z0, renamable $p0, %stack.1.object, -8 :: (store 8 into %ir.object, align 8)
    RET_ReallyLR implicit $z0
...

---
name:            testcase_positive_offset_out_of_range
tracksRegLiveness: true
stack:
  - { id: 0, name: dummy, type: default, offset: 0, size: 32, alignment: 16, stack-id: scalable-vector }
  - { id: 1, name: object, type: default, offset: 0, size: 32, alignment: 16, stack-id: scalable-vector }
body:             |
  bb.0 (%ir-block.0):
    liveins: $p0

    ; CHECK-LABEL: name: testcase_positive_offset_out_of_range
    ; CHECK: liveins: $p0
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: early-clobber $sp = frame-setup STRXpre killed $fp, $sp, -16 :: (store (s64) into %stack.2)
    ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
    ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $w29, -16
    ; CHECK-NEXT: $sp = frame-setup ADDVL_XXI $sp, -4
    ; CHECK-NEXT: frame-setup CFI_INSTRUCTION escape 0x0f, 0x0c, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0x20, 0x92, 0x2e, 0x00, 0x1e, 0x22
    ; CHECK-NEXT: $x8 = ADDVL_XXI $sp, 1
    ; CHECK-NEXT: renamable $z0 = LDNT1B_ZRI renamable $p0, killed $x8, 7 :: (load (s8) from %ir.object, align 2)
    ; CHECK-NEXT: $x8 = ADDVL_XXI $sp, 1
    ; CHECK-NEXT: renamable $z0 = LDNT1H_ZRI renamable $p0, killed $x8, 7 :: (load (s16) from %ir.object)
    ; CHECK-NEXT: $x8 = ADDVL_XXI $sp, 1
    ; CHECK-NEXT: renamable $z0 = LDNT1W_ZRI renamable $p0, killed $x8, 7 :: (load (s32) from %ir.object)
    ; CHECK-NEXT: $x8 = ADDVL_XXI $sp, 1
    ; CHECK-NEXT: renamable $z0 = LDNT1D_ZRI renamable $p0, killed $x8, 7 :: (load (s64) from %ir.object)
    ; CHECK-NEXT: $x8 = ADDVL_XXI $sp, 1
    ; CHECK-NEXT: STNT1B_ZRI renamable $z0, renamable $p0, killed $x8, 7 :: (store (s8) into %ir.object, align 8)
    ; CHECK-NEXT: $x8 = ADDVL_XXI $sp, 1
    ; CHECK-NEXT: STNT1H_ZRI renamable $z0, renamable $p0, killed $x8, 7 :: (store (s16) into %ir.object, align 8)
    ; CHECK-NEXT: $x8 = ADDVL_XXI $sp, 1
    ; CHECK-NEXT: STNT1W_ZRI renamable $z0, renamable $p0, killed $x8, 7 :: (store (s32) into %ir.object, align 8)
    ; CHECK-NEXT: $x8 = ADDVL_XXI $sp, 1
    ; CHECK-NEXT: STNT1D_ZRI renamable $z0, renamable $p0, killed $x8, 7 :: (store (s64) into %ir.object)
    ; CHECK-NEXT: $sp = frame-destroy ADDVL_XXI $sp, 4
    ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION def_cfa $wsp, 16
    ; CHECK-NEXT: early-clobber $sp, $fp = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.2)
    ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION def_cfa_offset 0
    ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION restore $w29
    ; CHECK-NEXT: RET_ReallyLR implicit $z0
    renamable $z0 = LDNT1B_ZRI renamable $p0, %stack.1.object, 8 :: (load 1 from %ir.object, align 2)
    renamable $z0 = LDNT1H_ZRI renamable $p0, %stack.1.object, 8 :: (load 2 from %ir.object, align 2)
    renamable $z0 = LDNT1W_ZRI renamable $p0, %stack.1.object, 8 :: (load 4 from %ir.object, align 4)
    renamable $z0 = LDNT1D_ZRI renamable $p0, %stack.1.object, 8 :: (load 8 from %ir.object, align 8)
    STNT1B_ZRI renamable $z0, renamable $p0, %stack.1.object, 8 :: (store 1 into %ir.object, align 8)
    STNT1H_ZRI renamable $z0, renamable $p0, %stack.1.object, 8 :: (store 2 into %ir.object, align 8)
    STNT1W_ZRI renamable $z0, renamable $p0, %stack.1.object, 8 :: (store 4 into %ir.object, align 8)
    STNT1D_ZRI renamable $z0, renamable $p0, %stack.1.object, 8 :: (store 8 into %ir.object, align 8)
    RET_ReallyLR implicit $z0
...

---
name:            testcase_negative_offset_out_of_range
tracksRegLiveness: true
stack:
  - { id: 0, name: dummy, type: default, offset: 0, size: 32, alignment: 16, stack-id: scalable-vector }
  - { id: 1, name: object, type: default, offset: 0, size: 32, alignment: 16, stack-id: scalable-vector }
body:             |
  bb.0 (%ir-block.0):
    liveins: $p0

    ; CHECK-LABEL: name: testcase_negative_offset_out_of_range
    ; CHECK: liveins: $p0
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: early-clobber $sp = frame-setup STRXpre killed $fp, $sp, -16 :: (store (s64) into %stack.2)
    ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
    ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $w29, -16
    ; CHECK-NEXT: $sp = frame-setup ADDVL_XXI $sp, -4
    ; CHECK-NEXT: frame-setup CFI_INSTRUCTION escape 0x0f, 0x0c, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0x20, 0x92, 0x2e, 0x00, 0x1e, 0x22
    ; CHECK-NEXT: $x8 = ADDVL_XXI $sp, -1
    ; CHECK-NEXT: renamable $z0 = LDNT1B_ZRI renamable $p0, killed $x8, -8 :: (load (s8) from %ir.object, align 2)
    ; CHECK-NEXT: $x8 = ADDVL_XXI $sp, -1
    ; CHECK-NEXT: renamable $z0 = LDNT1H_ZRI renamable $p0, killed $x8, -8 :: (load (s16) from %ir.object)
    ; CHECK-NEXT: $x8 = ADDVL_XXI $sp, -1
    ; CHECK-NEXT: renamable $z0 = LDNT1W_ZRI renamable $p0, killed $x8, -8 :: (load (s32) from %ir.object)
    ; CHECK-NEXT: $x8 = ADDVL_XXI $sp, -1
    ; CHECK-NEXT: renamable $z0 = LDNT1D_ZRI renamable $p0, killed $x8, -8 :: (load (s64) from %ir.object)
    ; CHECK-NEXT: $x8 = ADDVL_XXI $sp, -1
    ; CHECK-NEXT: STNT1B_ZRI renamable $z0, renamable $p0, killed $x8, -8 :: (store (s8) into %ir.object, align 8)
    ; CHECK-NEXT: $x8 = ADDVL_XXI $sp, -1
    ; CHECK-NEXT: STNT1H_ZRI renamable $z0, renamable $p0, killed $x8, -8 :: (store (s16) into %ir.object, align 8)
    ; CHECK-NEXT: $x8 = ADDVL_XXI $sp, -1
    ; CHECK-NEXT: STNT1W_ZRI renamable $z0, renamable $p0, killed $x8, -8 :: (store (s32) into %ir.object, align 8)
    ; CHECK-NEXT: $x8 = ADDVL_XXI $sp, -1
    ; CHECK-NEXT: STNT1D_ZRI renamable $z0, renamable $p0, killed $x8, -8 :: (store (s64) into %ir.object)
    ; CHECK-NEXT: $sp = frame-destroy ADDVL_XXI $sp, 4
    ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION def_cfa $wsp, 16
    ; CHECK-NEXT: early-clobber $sp, $fp = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.2)
    ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION def_cfa_offset 0
    ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION restore $w29
    ; CHECK-NEXT: RET_ReallyLR implicit $z0
    renamable $z0 = LDNT1B_ZRI renamable $p0, %stack.1.object, -9 :: (load 1 from %ir.object, align 2)
    renamable $z0 = LDNT1H_ZRI renamable $p0, %stack.1.object, -9 :: (load 2 from %ir.object, align 2)
    renamable $z0 = LDNT1W_ZRI renamable $p0, %stack.1.object, -9 :: (load 4 from %ir.object, align 4)
    renamable $z0 = LDNT1D_ZRI renamable $p0, %stack.1.object, -9 :: (load 8 from %ir.object, align 8)
    STNT1B_ZRI renamable $z0, renamable $p0, %stack.1.object, -9 :: (store 1 into %ir.object, align 8)
    STNT1H_ZRI renamable $z0, renamable $p0, %stack.1.object, -9 :: (store 2 into %ir.object, align 8)
    STNT1W_ZRI renamable $z0, renamable $p0, %stack.1.object, -9 :: (store 4 into %ir.object, align 8)
    STNT1D_ZRI renamable $z0, renamable $p0, %stack.1.object, -9 :: (store 8 into %ir.object, align 8)
    RET_ReallyLR implicit $z0
...