1
1
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --filter-out "(?!^\s*lda.*\bsp\b)^\s*.*\bsp\b" --filter "^\s*(ld|st[^r]|swp|cas|bl|add|and|eor|orn|orr|sub|mvn|sxt|cmp|ccmp|csel|dmb)"
2
2
; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+v8.4a -mattr=+rcpc-immo -global-isel=true -global-isel-abort=2 -O0 | FileCheck %s --check-prefixes=CHECK,GISEL
3
- ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+v8.4a -mattr=+rcpc-immo -global-isel=false -O1 | FileCheck %s --check-prefixes=CHECK,SDAG
3
+ ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+v8.4a -mattr=+rcpc-immo -global-isel=false -O1 | FileCheck %s --check-prefixes=CHECK,SDAG,SDAG-NOAVOIDLDAPUR
4
+ ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+v8.4a -mattr=+rcpc-immo,avoid-ldapur -global-isel=false -O1 | FileCheck %s --check-prefixes=CHECK,SDAG,SDAG-AVOIDLDAPUR
5
+ ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mcpu=neoverse-v2 -global-isel=false -O1 | FileCheck %s --check-prefixes=CHECK,SDAG,SDAG-AVOIDLDAPUR
6
+ ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mcpu=neoverse-v3 -global-isel=false -O1 | FileCheck %s --check-prefixes=CHECK,SDAG,SDAG-AVOIDLDAPUR
7
+ ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mcpu=cortex-x3 -global-isel=false -O1 | FileCheck %s --check-prefixes=CHECK,SDAG,SDAG-AVOIDLDAPUR
8
+ ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mcpu=cortex-x4 -global-isel=false -O1 | FileCheck %s --check-prefixes=CHECK,SDAG,SDAG-AVOIDLDAPUR
9
+ ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mcpu=cortex-x925 -global-isel=false -O1 | FileCheck %s --check-prefixes=CHECK,SDAG,SDAG-AVOIDLDAPUR
4
10
5
11
define i8 @load_atomic_i8_aligned_unordered (ptr %ptr ) {
6
12
; CHECK-LABEL: load_atomic_i8_aligned_unordered:
@@ -39,8 +45,12 @@ define i8 @load_atomic_i8_aligned_acquire(ptr %ptr) {
39
45
; GISEL: add x8, x0, #4
40
46
; GISEL: ldaprb w0, [x8]
41
47
;
42
- ; SDAG-LABEL: load_atomic_i8_aligned_acquire:
43
- ; SDAG: ldapurb w0, [x0, #4]
48
+ ; SDAG-NOAVOIDLDAPUR-LABEL: load_atomic_i8_aligned_acquire:
49
+ ; SDAG-NOAVOIDLDAPUR: ldapurb w0, [x0, #4]
50
+ ;
51
+ ; SDAG-AVOIDLDAPUR-LABEL: load_atomic_i8_aligned_acquire:
52
+ ; SDAG-AVOIDLDAPUR: add x8, x0, #4
53
+ ; SDAG-AVOIDLDAPUR: ldaprb w0, [x8]
44
54
%gep = getelementptr inbounds i8 , ptr %ptr , i32 4
45
55
%r = load atomic i8 , ptr %gep acquire , align 1
46
56
ret i8 %r
@@ -51,8 +61,12 @@ define i8 @load_atomic_i8_aligned_acquire_const(ptr readonly %ptr) {
51
61
; GISEL: add x8, x0, #4
52
62
; GISEL: ldaprb w0, [x8]
53
63
;
54
- ; SDAG-LABEL: load_atomic_i8_aligned_acquire_const:
55
- ; SDAG: ldapurb w0, [x0, #4]
64
+ ; SDAG-NOAVOIDLDAPUR-LABEL: load_atomic_i8_aligned_acquire_const:
65
+ ; SDAG-NOAVOIDLDAPUR: ldapurb w0, [x0, #4]
66
+ ;
67
+ ; SDAG-AVOIDLDAPUR-LABEL: load_atomic_i8_aligned_acquire_const:
68
+ ; SDAG-AVOIDLDAPUR: add x8, x0, #4
69
+ ; SDAG-AVOIDLDAPUR: ldaprb w0, [x8]
56
70
%gep = getelementptr inbounds i8 , ptr %ptr , i32 4
57
71
%r = load atomic i8 , ptr %gep acquire , align 1
58
72
ret i8 %r
@@ -113,8 +127,12 @@ define i16 @load_atomic_i16_aligned_acquire(ptr %ptr) {
113
127
; GISEL: add x8, x0, #8
114
128
; GISEL: ldaprh w0, [x8]
115
129
;
116
- ; SDAG-LABEL: load_atomic_i16_aligned_acquire:
117
- ; SDAG: ldapurh w0, [x0, #8]
130
+ ; SDAG-NOAVOIDLDAPUR-LABEL: load_atomic_i16_aligned_acquire:
131
+ ; SDAG-NOAVOIDLDAPUR: ldapurh w0, [x0, #8]
132
+ ;
133
+ ; SDAG-AVOIDLDAPUR-LABEL: load_atomic_i16_aligned_acquire:
134
+ ; SDAG-AVOIDLDAPUR: add x8, x0, #8
135
+ ; SDAG-AVOIDLDAPUR: ldaprh w0, [x8]
118
136
%gep = getelementptr inbounds i16 , ptr %ptr , i32 4
119
137
%r = load atomic i16 , ptr %gep acquire , align 2
120
138
ret i16 %r
@@ -125,8 +143,12 @@ define i16 @load_atomic_i16_aligned_acquire_const(ptr readonly %ptr) {
125
143
; GISEL: add x8, x0, #8
126
144
; GISEL: ldaprh w0, [x8]
127
145
;
128
- ; SDAG-LABEL: load_atomic_i16_aligned_acquire_const:
129
- ; SDAG: ldapurh w0, [x0, #8]
146
+ ; SDAG-NOAVOIDLDAPUR-LABEL: load_atomic_i16_aligned_acquire_const:
147
+ ; SDAG-NOAVOIDLDAPUR: ldapurh w0, [x0, #8]
148
+ ;
149
+ ; SDAG-AVOIDLDAPUR-LABEL: load_atomic_i16_aligned_acquire_const:
150
+ ; SDAG-AVOIDLDAPUR: add x8, x0, #8
151
+ ; SDAG-AVOIDLDAPUR: ldaprh w0, [x8]
130
152
%gep = getelementptr inbounds i16 , ptr %ptr , i32 4
131
153
%r = load atomic i16 , ptr %gep acquire , align 2
132
154
ret i16 %r
@@ -183,16 +205,30 @@ define i32 @load_atomic_i32_aligned_monotonic_const(ptr readonly %ptr) {
183
205
}
184
206
185
207
define i32 @load_atomic_i32_aligned_acquire (ptr %ptr ) {
186
- ; CHECK-LABEL: load_atomic_i32_aligned_acquire:
187
- ; CHECK: ldapur w0, [x0, #16]
208
+ ; GISEL-LABEL: load_atomic_i32_aligned_acquire:
209
+ ; GISEL: ldapur w0, [x0, #16]
210
+ ;
211
+ ; SDAG-NOAVOIDLDAPUR-LABEL: load_atomic_i32_aligned_acquire:
212
+ ; SDAG-NOAVOIDLDAPUR: ldapur w0, [x0, #16]
213
+ ;
214
+ ; SDAG-AVOIDLDAPUR-LABEL: load_atomic_i32_aligned_acquire:
215
+ ; SDAG-AVOIDLDAPUR: add x8, x0, #16
216
+ ; SDAG-AVOIDLDAPUR: ldapr w0, [x8]
188
217
%gep = getelementptr inbounds i32 , ptr %ptr , i32 4
189
218
%r = load atomic i32 , ptr %gep acquire , align 4
190
219
ret i32 %r
191
220
}
192
221
193
222
define i32 @load_atomic_i32_aligned_acquire_const (ptr readonly %ptr ) {
194
- ; CHECK-LABEL: load_atomic_i32_aligned_acquire_const:
195
- ; CHECK: ldapur w0, [x0, #16]
223
+ ; GISEL-LABEL: load_atomic_i32_aligned_acquire_const:
224
+ ; GISEL: ldapur w0, [x0, #16]
225
+ ;
226
+ ; SDAG-NOAVOIDLDAPUR-LABEL: load_atomic_i32_aligned_acquire_const:
227
+ ; SDAG-NOAVOIDLDAPUR: ldapur w0, [x0, #16]
228
+ ;
229
+ ; SDAG-AVOIDLDAPUR-LABEL: load_atomic_i32_aligned_acquire_const:
230
+ ; SDAG-AVOIDLDAPUR: add x8, x0, #16
231
+ ; SDAG-AVOIDLDAPUR: ldapr w0, [x8]
196
232
%gep = getelementptr inbounds i32 , ptr %ptr , i32 4
197
233
%r = load atomic i32 , ptr %gep acquire , align 4
198
234
ret i32 %r
@@ -249,16 +285,30 @@ define i64 @load_atomic_i64_aligned_monotonic_const(ptr readonly %ptr) {
249
285
}
250
286
251
287
define i64 @load_atomic_i64_aligned_acquire (ptr %ptr ) {
252
- ; CHECK-LABEL: load_atomic_i64_aligned_acquire:
253
- ; CHECK: ldapur x0, [x0, #32]
288
+ ; GISEL-LABEL: load_atomic_i64_aligned_acquire:
289
+ ; GISEL: ldapur x0, [x0, #32]
290
+ ;
291
+ ; SDAG-NOAVOIDLDAPUR-LABEL: load_atomic_i64_aligned_acquire:
292
+ ; SDAG-NOAVOIDLDAPUR: ldapur x0, [x0, #32]
293
+ ;
294
+ ; SDAG-AVOIDLDAPUR-LABEL: load_atomic_i64_aligned_acquire:
295
+ ; SDAG-AVOIDLDAPUR: add x8, x0, #32
296
+ ; SDAG-AVOIDLDAPUR: ldapr x0, [x8]
254
297
%gep = getelementptr inbounds i64 , ptr %ptr , i32 4
255
298
%r = load atomic i64 , ptr %gep acquire , align 8
256
299
ret i64 %r
257
300
}
258
301
259
302
define i64 @load_atomic_i64_aligned_acquire_const (ptr readonly %ptr ) {
260
- ; CHECK-LABEL: load_atomic_i64_aligned_acquire_const:
261
- ; CHECK: ldapur x0, [x0, #32]
303
+ ; GISEL-LABEL: load_atomic_i64_aligned_acquire_const:
304
+ ; GISEL: ldapur x0, [x0, #32]
305
+ ;
306
+ ; SDAG-NOAVOIDLDAPUR-LABEL: load_atomic_i64_aligned_acquire_const:
307
+ ; SDAG-NOAVOIDLDAPUR: ldapur x0, [x0, #32]
308
+ ;
309
+ ; SDAG-AVOIDLDAPUR-LABEL: load_atomic_i64_aligned_acquire_const:
310
+ ; SDAG-AVOIDLDAPUR: add x8, x0, #32
311
+ ; SDAG-AVOIDLDAPUR: ldapr x0, [x8]
262
312
%gep = getelementptr inbounds i64 , ptr %ptr , i32 4
263
313
%r = load atomic i64 , ptr %gep acquire , align 8
264
314
ret i64 %r
@@ -387,8 +437,12 @@ define i8 @load_atomic_i8_unaligned_acquire(ptr %ptr) {
387
437
; GISEL: add x8, x0, #4
388
438
; GISEL: ldaprb w0, [x8]
389
439
;
390
- ; SDAG-LABEL: load_atomic_i8_unaligned_acquire:
391
- ; SDAG: ldapurb w0, [x0, #4]
440
+ ; SDAG-NOAVOIDLDAPUR-LABEL: load_atomic_i8_unaligned_acquire:
441
+ ; SDAG-NOAVOIDLDAPUR: ldapurb w0, [x0, #4]
442
+ ;
443
+ ; SDAG-AVOIDLDAPUR-LABEL: load_atomic_i8_unaligned_acquire:
444
+ ; SDAG-AVOIDLDAPUR: add x8, x0, #4
445
+ ; SDAG-AVOIDLDAPUR: ldaprb w0, [x8]
392
446
%gep = getelementptr inbounds i8 , ptr %ptr , i32 4
393
447
%r = load atomic i8 , ptr %gep acquire , align 1
394
448
ret i8 %r
@@ -399,8 +453,12 @@ define i8 @load_atomic_i8_unaligned_acquire_const(ptr readonly %ptr) {
399
453
; GISEL: add x8, x0, #4
400
454
; GISEL: ldaprb w0, [x8]
401
455
;
402
- ; SDAG-LABEL: load_atomic_i8_unaligned_acquire_const:
403
- ; SDAG: ldapurb w0, [x0, #4]
456
+ ; SDAG-NOAVOIDLDAPUR-LABEL: load_atomic_i8_unaligned_acquire_const:
457
+ ; SDAG-NOAVOIDLDAPUR: ldapurb w0, [x0, #4]
458
+ ;
459
+ ; SDAG-AVOIDLDAPUR-LABEL: load_atomic_i8_unaligned_acquire_const:
460
+ ; SDAG-AVOIDLDAPUR: add x8, x0, #4
461
+ ; SDAG-AVOIDLDAPUR: ldaprb w0, [x8]
404
462
%gep = getelementptr inbounds i8 , ptr %ptr , i32 4
405
463
%r = load atomic i8 , ptr %gep acquire , align 1
406
464
ret i8 %r
@@ -846,9 +904,14 @@ define i8 @load_atomic_i8_from_gep() {
846
904
; GISEL: add x8, x8, #1
847
905
; GISEL: ldaprb w0, [x8]
848
906
;
849
- ; SDAG-LABEL: load_atomic_i8_from_gep:
850
- ; SDAG: bl init
851
- ; SDAG: ldapurb w0, [sp, #13]
907
+ ; SDAG-NOAVOIDLDAPUR-LABEL: load_atomic_i8_from_gep:
908
+ ; SDAG-NOAVOIDLDAPUR: bl init
909
+ ; SDAG-NOAVOIDLDAPUR: ldapurb w0, [sp, #13]
910
+ ;
911
+ ; SDAG-AVOIDLDAPUR-LABEL: load_atomic_i8_from_gep:
912
+ ; SDAG-AVOIDLDAPUR: bl init
913
+ ; SDAG-AVOIDLDAPUR: orr x8, x19, #0x1
914
+ ; SDAG-AVOIDLDAPUR: ldaprb w0, [x8]
852
915
%a = alloca [3 x i8 ]
853
916
call void @init (ptr %a )
854
917
%arrayidx = getelementptr [3 x i8 ], ptr %a , i64 0 , i64 1
@@ -862,9 +925,14 @@ define i16 @load_atomic_i16_from_gep() {
862
925
; GISEL: add x8, x8, #2
863
926
; GISEL: ldaprh w0, [x8]
864
927
;
865
- ; SDAG-LABEL: load_atomic_i16_from_gep:
866
- ; SDAG: bl init
867
- ; SDAG: ldapurh w0, [sp, #10]
928
+ ; SDAG-NOAVOIDLDAPUR-LABEL: load_atomic_i16_from_gep:
929
+ ; SDAG-NOAVOIDLDAPUR: bl init
930
+ ; SDAG-NOAVOIDLDAPUR: ldapurh w0, [sp, #10]
931
+ ;
932
+ ; SDAG-AVOIDLDAPUR-LABEL: load_atomic_i16_from_gep:
933
+ ; SDAG-AVOIDLDAPUR: bl init
934
+ ; SDAG-AVOIDLDAPUR: orr x8, x19, #0x2
935
+ ; SDAG-AVOIDLDAPUR: ldaprh w0, [x8]
868
936
%a = alloca [3 x i16 ]
869
937
call void @init (ptr %a )
870
938
%arrayidx = getelementptr [3 x i16 ], ptr %a , i64 0 , i64 1
@@ -877,9 +945,14 @@ define i32 @load_atomic_i32_from_gep() {
877
945
; GISEL: bl init
878
946
; GISEL: ldapur w0, [x8, #4]
879
947
;
880
- ; SDAG-LABEL: load_atomic_i32_from_gep:
881
- ; SDAG: bl init
882
- ; SDAG: ldapur w0, [sp, #8]
948
+ ; SDAG-NOAVOIDLDAPUR-LABEL: load_atomic_i32_from_gep:
949
+ ; SDAG-NOAVOIDLDAPUR: bl init
950
+ ; SDAG-NOAVOIDLDAPUR: ldapur w0, [sp, #8]
951
+ ;
952
+ ; SDAG-AVOIDLDAPUR-LABEL: load_atomic_i32_from_gep:
953
+ ; SDAG-AVOIDLDAPUR: bl init
954
+ ; SDAG-AVOIDLDAPUR: add x8, x19, #4
955
+ ; SDAG-AVOIDLDAPUR: ldapr w0, [x8]
883
956
%a = alloca [3 x i32 ]
884
957
call void @init (ptr %a )
885
958
%arrayidx = getelementptr [3 x i32 ], ptr %a , i64 0 , i64 1
@@ -892,9 +965,14 @@ define i64 @load_atomic_i64_from_gep() {
892
965
; GISEL: bl init
893
966
; GISEL: ldapur x0, [x8, #8]
894
967
;
895
- ; SDAG-LABEL: load_atomic_i64_from_gep:
896
- ; SDAG: bl init
897
- ; SDAG: ldapur x0, [sp, #16]
968
+ ; SDAG-NOAVOIDLDAPUR-LABEL: load_atomic_i64_from_gep:
969
+ ; SDAG-NOAVOIDLDAPUR: bl init
970
+ ; SDAG-NOAVOIDLDAPUR: ldapur x0, [sp, #16]
971
+ ;
972
+ ; SDAG-AVOIDLDAPUR-LABEL: load_atomic_i64_from_gep:
973
+ ; SDAG-AVOIDLDAPUR: bl init
974
+ ; SDAG-AVOIDLDAPUR: add x8, x19, #8
975
+ ; SDAG-AVOIDLDAPUR: ldapr x0, [x8]
898
976
%a = alloca [3 x i64 ]
899
977
call void @init (ptr %a )
900
978
%arrayidx = getelementptr [3 x i64 ], ptr %a , i64 0 , i64 1
0 commit comments