1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
3 ; RUN: llc %s -o - -mtriple=aarch64 -O2 -mattr=+mops | FileCheck %s --check-prefix=CHECK-MOPS
5 declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg)
7 declare void @fn(ptr, ptr)
9 define void @consecutive() {
10 ; CHECK-MOPS-LABEL: consecutive:
11 ; CHECK-MOPS: // %bb.0: // %entry
12 ; CHECK-MOPS-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
13 ; CHECK-MOPS-NEXT: sub sp, sp, #2016
14 ; CHECK-MOPS-NEXT: .cfi_def_cfa_offset 2032
15 ; CHECK-MOPS-NEXT: .cfi_offset w30, -8
16 ; CHECK-MOPS-NEXT: .cfi_offset w29, -16
17 ; CHECK-MOPS-NEXT: mov w8, #1000 // =0x3e8
18 ; CHECK-MOPS-NEXT: add x9, sp, #8
19 ; CHECK-MOPS-NEXT: adrp x10, .LCPI0_0
20 ; CHECK-MOPS-NEXT: adrp x11, .LCPI0_1
21 ; CHECK-MOPS-NEXT: setp [x9]!, x8!, xzr
22 ; CHECK-MOPS-NEXT: setm [x9]!, x8!, xzr
23 ; CHECK-MOPS-NEXT: sete [x9]!, x8!, xzr
24 ; CHECK-MOPS-NEXT: mov w12, #6424 // =0x1918
25 ; CHECK-MOPS-NEXT: ldr q0, [x10, :lo12:.LCPI0_0]
26 ; CHECK-MOPS-NEXT: ldr d1, [x11, :lo12:.LCPI0_1]
27 ; CHECK-MOPS-NEXT: mov w8, #7452 // =0x1d1c
28 ; CHECK-MOPS-NEXT: movk w12, #6938, lsl #16
29 ; CHECK-MOPS-NEXT: strh w8, [sp, #1036]
30 ; CHECK-MOPS-NEXT: mov w8, #30 // =0x1e
31 ; CHECK-MOPS-NEXT: add x0, sp, #1008
32 ; CHECK-MOPS-NEXT: add x1, sp, #8
33 ; CHECK-MOPS-NEXT: str w12, [sp, #1032]
34 ; CHECK-MOPS-NEXT: str q0, [sp, #1008]
35 ; CHECK-MOPS-NEXT: str d1, [sp, #1024]
36 ; CHECK-MOPS-NEXT: strb w8, [sp, #1038]
37 ; CHECK-MOPS-NEXT: bl fn
38 ; CHECK-MOPS-NEXT: add sp, sp, #2016
39 ; CHECK-MOPS-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
40 ; CHECK-MOPS-NEXT: ret
42 %buf_from = alloca [1000 x i8], align 16
43 %buf_to = alloca [1000 x i8], align 1
44 call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1000) %buf_to, i8 0, i64 1000, i1 false)
45 store <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, ptr %buf_from, align 16
46 %arrayidx.16 = getelementptr inbounds [1000 x i8], ptr %buf_from, i64 0, i64 16
47 store <8 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23>, ptr %arrayidx.16, align 16
48 %arrayidx.24 = getelementptr inbounds [1000 x i8], ptr %buf_from, i64 0, i64 24
49 store i8 24, ptr %arrayidx.24, align 8
50 %arrayidx.25 = getelementptr inbounds [1000 x i8], ptr %buf_from, i64 0, i64 25
51 store i8 25, ptr %arrayidx.25, align 1
52 %arrayidx.26 = getelementptr inbounds [1000 x i8], ptr %buf_from, i64 0, i64 26
53 store i8 26, ptr %arrayidx.26, align 2
54 %arrayidx.27 = getelementptr inbounds [1000 x i8], ptr %buf_from, i64 0, i64 27
55 store i8 27, ptr %arrayidx.27, align 1
56 %arrayidx.28 = getelementptr inbounds [1000 x i8], ptr %buf_from, i64 0, i64 28
57 store i8 28, ptr %arrayidx.28, align 4
58 %arrayidx.29 = getelementptr inbounds [1000 x i8], ptr %buf_from, i64 0, i64 29
59 store i8 29, ptr %arrayidx.29, align 1
60 %arrayidx.30 = getelementptr inbounds [1000 x i8], ptr %buf_from, i64 0, i64 30
61 store i8 30, ptr %arrayidx.30, align 2
62 call void @fn(ptr nonnull %buf_from, ptr nonnull %buf_to)