Skip to content

Commit 88d0ceb

Browse files
[AArch64] Additional test coverage for PR67879 (NFC)
Introduce further test exercizing `isAArch64FrameOffsetLegal`.
1 parent aeedc07 commit 88d0ceb

File tree

2 files changed

+164
-2
lines changed

2 files changed

+164
-2
lines changed

llvm/test/CodeGen/AArch64/Atomics/aarch64-atomic-load-rcpc_immo.ll

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --filter-out "\b(sp)\b" --filter "^\s*(ld|st[^r]|swp|cas|bl|add|and|eor|orn|orr|sub|mvn|sxt|cmp|ccmp|csel|dmb)"
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)"
22
; 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
33
; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+v8.4a -mattr=+rcpc-immo -global-isel=false -O1 | FileCheck %s --check-prefixes=CHECK,SDAG
44

@@ -815,3 +815,82 @@ define i128 @load_atomic_i128_unaligned_seq_cst_const(ptr readonly %ptr) {
815815
%r = load atomic i128, ptr %gep seq_cst, align 1
816816
ret i128 %r
817817
}
818+
819+
define i8 @load_atomic_i8_from_gep() {
820+
; GISEL-LABEL: load_atomic_i8_from_gep:
821+
; GISEL: bl init
822+
; GISEL: ldapurb w0, [x8, #1]
823+
;
824+
; SDAG-LABEL: load_atomic_i8_from_gep:
825+
; SDAG: bl init
826+
; SDAG: ldapurb w0, [sp, #13]
827+
%a = alloca [3 x i8]
828+
call void @init(ptr %a)
829+
%arrayidx = getelementptr [3 x i8], ptr %a, i64 0, i64 1
830+
%l = load atomic i8, ptr %arrayidx acquire, align 8
831+
ret i8 %l
832+
}
833+
834+
define i16 @load_atomic_i16_from_gep() {
835+
; GISEL-LABEL: load_atomic_i16_from_gep:
836+
; GISEL: bl init
837+
; GISEL: ldapurh w0, [x8, #2]
838+
;
839+
; SDAG-LABEL: load_atomic_i16_from_gep:
840+
; SDAG: bl init
841+
; SDAG: ldapurh w0, [sp, #10]
842+
%a = alloca [3 x i16]
843+
call void @init(ptr %a)
844+
%arrayidx = getelementptr [3 x i16], ptr %a, i64 0, i64 1
845+
%l = load atomic i16, ptr %arrayidx acquire, align 8
846+
ret i16 %l
847+
}
848+
849+
define i32 @load_atomic_i32_from_gep() {
850+
; GISEL-LABEL: load_atomic_i32_from_gep:
851+
; GISEL: bl init
852+
; GISEL: ldapur w0, [x8, #4]
853+
;
854+
; SDAG-LABEL: load_atomic_i32_from_gep:
855+
; SDAG: bl init
856+
; SDAG: ldapur w0, [sp, #8]
857+
%a = alloca [3 x i32]
858+
call void @init(ptr %a)
859+
%arrayidx = getelementptr [3 x i32], ptr %a, i64 0, i64 1
860+
%l = load atomic i32, ptr %arrayidx acquire, align 8
861+
ret i32 %l
862+
}
863+
864+
define i64 @load_atomic_i64_from_gep() {
865+
; GISEL-LABEL: load_atomic_i64_from_gep:
866+
; GISEL: bl init
867+
; GISEL: ldapur x0, [x8, #8]
868+
;
869+
; SDAG-LABEL: load_atomic_i64_from_gep:
870+
; SDAG: bl init
871+
; SDAG: ldapur x0, [sp, #16]
872+
%a = alloca [3 x i64]
873+
call void @init(ptr %a)
874+
%arrayidx = getelementptr [3 x i64], ptr %a, i64 0, i64 1
875+
%l = load atomic i64, ptr %arrayidx acquire, align 8
876+
ret i64 %l
877+
}
878+
879+
define i128 @load_atomic_i128_from_gep() {
880+
; GISEL-LABEL: load_atomic_i128_from_gep:
881+
; GISEL: bl init
882+
; GISEL: ldp x0, x1, [x8, #16]
883+
; GISEL: dmb ishld
884+
;
885+
; SDAG-LABEL: load_atomic_i128_from_gep:
886+
; SDAG: bl init
887+
; SDAG: ldp x0, x1, [sp, #16]
888+
; SDAG: dmb ishld
889+
%a = alloca [3 x i128]
890+
call void @init(ptr %a)
891+
%arrayidx = getelementptr [3 x i128], ptr %a, i64 0, i64 1
892+
%l = load atomic i128, ptr %arrayidx acquire, align 16
893+
ret i128 %l
894+
}
895+
896+
declare void @init(ptr)

llvm/test/CodeGen/AArch64/Atomics/aarch64-atomic-store-rcpc_immo.ll

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --filter-out "\b(sp)\b" --filter "^\s*(ld[^r]|st|swp|cas|bl|add|and|eor|orn|orr|sub|mvn|sxt|cmp|ccmp|csel|dmb)"
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --filter-out "(?!^\s*stl.*\bsp\b)^\s*.*\bsp\b" --filter "^\s*(ld[^r]|st|swp|cas|bl|add|and|eor|orn|orr|sub|mvn|sxt|cmp|ccmp|csel|dmb)"
22
; 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
33
; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+v8.4a -mattr=+rcpc-immo -global-isel=false -O1 | FileCheck %s --check-prefixes=CHECK,SDAG
44

@@ -356,3 +356,86 @@ define void @store_atomic_i128_unaligned_seq_cst(i128 %value, ptr %ptr) {
356356
store atomic i128 %value, ptr %gep seq_cst, align 1
357357
ret void
358358
}
359+
360+
; TODO: missed opportunity to emit a stlurb w/ GISel
361+
define void @store_atomic_i8_from_gep() {
362+
; GISEL-LABEL: store_atomic_i8_from_gep:
363+
; GISEL: bl init
364+
; GISEL: add x9, x8, #1
365+
; GISEL: stlrb w8, [x9]
366+
;
367+
; SDAG-LABEL: store_atomic_i8_from_gep:
368+
; SDAG: bl init
369+
; SDAG: stlurb wzr, [sp, #13]
370+
%a = alloca [3 x i8]
371+
call void @init(ptr %a)
372+
%arrayidx = getelementptr [3 x i8], ptr %a, i64 0, i64 1
373+
store atomic i8 0, ptr %arrayidx release, align 8
374+
ret void
375+
}
376+
377+
; TODO: missed opportunity to emit a stlurh w/ GISel
378+
define void @store_atomic_i16_from_gep() {
379+
; GISEL-LABEL: store_atomic_i16_from_gep:
380+
; GISEL: bl init
381+
; GISEL: add x9, x8, #2
382+
; GISEL: stlrh w8, [x9]
383+
;
384+
; SDAG-LABEL: store_atomic_i16_from_gep:
385+
; SDAG: bl init
386+
; SDAG: stlurh wzr, [sp, #10]
387+
%a = alloca [3 x i16]
388+
call void @init(ptr %a)
389+
%arrayidx = getelementptr [3 x i16], ptr %a, i64 0, i64 1
390+
store atomic i16 0, ptr %arrayidx release, align 8
391+
ret void
392+
}
393+
394+
define void @store_atomic_i32_from_gep() {
395+
; GISEL-LABEL: store_atomic_i32_from_gep:
396+
; GISEL: bl init
397+
; GISEL: stlur w8, [x9, #4]
398+
;
399+
; SDAG-LABEL: store_atomic_i32_from_gep:
400+
; SDAG: bl init
401+
; SDAG: stlur wzr, [sp, #8]
402+
%a = alloca [3 x i32]
403+
call void @init(ptr %a)
404+
%arrayidx = getelementptr [3 x i32], ptr %a, i64 0, i64 1
405+
store atomic i32 0, ptr %arrayidx release, align 8
406+
ret void
407+
}
408+
409+
define void @store_atomic_i64_from_gep() {
410+
; GISEL-LABEL: store_atomic_i64_from_gep:
411+
; GISEL: bl init
412+
; GISEL: stlur x8, [x9, #8]
413+
;
414+
; SDAG-LABEL: store_atomic_i64_from_gep:
415+
; SDAG: bl init
416+
; SDAG: stlur xzr, [sp, #16]
417+
%a = alloca [3 x i64]
418+
call void @init(ptr %a)
419+
%arrayidx = getelementptr [3 x i64], ptr %a, i64 0, i64 1
420+
store atomic i64 0, ptr %arrayidx release, align 8
421+
ret void
422+
}
423+
424+
define void @store_atomic_i128_from_gep() {
425+
; GISEL-LABEL: store_atomic_i128_from_gep:
426+
; GISEL: bl init
427+
; GISEL: dmb ish
428+
; GISEL: stp x8, x8, [x9, #16]
429+
;
430+
; SDAG-LABEL: store_atomic_i128_from_gep:
431+
; SDAG: bl init
432+
; SDAG: dmb ish
433+
; SDAG: stp xzr, xzr, [sp, #16]
434+
%a = alloca [3 x i128]
435+
call void @init(ptr %a)
436+
%arrayidx = getelementptr [3 x i128], ptr %a, i64 0, i64 1
437+
store atomic i128 0, ptr %arrayidx release, align 16
438+
ret void
439+
}
440+
441+
declare void @init(ptr)

0 commit comments

Comments
 (0)