1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc --mtriple=loongarch64 -mattr=+d < %s | FileCheck %s
6 define void @box(ptr noalias nocapture noundef writeonly sret(%Box) align 16 dereferenceable(48) %b, i64 %i) {
9 ; CHECK-NEXT: addi.d $sp, $sp, -96
10 ; CHECK-NEXT: .cfi_def_cfa_offset 96
11 ; CHECK-NEXT: slli.d $a2, $a1, 5
12 ; CHECK-NEXT: alsl.d $a1, $a1, $a2, 4
13 ; CHECK-NEXT: addi.d $a2, $sp, 0
14 ; CHECK-NEXT: add.d $a3, $a2, $a1
15 ; CHECK-NEXT: ldx.d $a1, $a1, $a2
16 ; CHECK-NEXT: ld.d $a2, $a3, 40
17 ; CHECK-NEXT: st.d $a1, $a0, 0
18 ; CHECK-NEXT: st.d $a2, $a0, 40
19 ; CHECK-NEXT: ld.d $a1, $a3, 32
20 ; CHECK-NEXT: ld.d $a2, $a3, 24
21 ; CHECK-NEXT: ld.d $a4, $a3, 16
22 ; CHECK-NEXT: ld.d $a3, $a3, 8
23 ; CHECK-NEXT: st.d $a1, $a0, 32
24 ; CHECK-NEXT: st.d $a2, $a0, 24
25 ; CHECK-NEXT: st.d $a4, $a0, 16
26 ; CHECK-NEXT: st.d $a3, $a0, 8
27 ; CHECK-NEXT: addi.d $sp, $sp, 96
29 %1 = alloca [2 x %Box], align 16
30 %2 = getelementptr inbounds [2 x %Box], ptr %1, i64 0, i64 %i
31 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(48) %b, ptr noundef nonnull align 16 dereferenceable(48) %2, i64 48, i1 false)