1 ; RUN: llc < %s -mtriple=thumbv7-apple-ios -mcpu=cortex-a8 -pre-RA-sched=source -disable-post-ra | FileCheck %s -check-prefix=CHECK-7A
2 ; RUN: llc < %s -mtriple=thumbv6m -pre-RA-sched=source -disable-post-ra -mattr=+strict-align | FileCheck %s -check-prefix=CHECK-6M
4 define void @t1(ptr nocapture %c) nounwind optsize {
7 ; CHECK-7A: movs r1, #0
8 ; CHECK-7A: strd r1, r1, [r0]
9 ; CHECK-7A: str r1, [r0, #8]
11 ; CHECK-6M: movs r1, #0
12 ; CHECK-6M: str r1, [r0]
13 ; CHECK-6M: str r1, [r0, #4]
14 ; CHECK-6M: str r1, [r0, #8]
15 call void @llvm.memset.p0.i64(ptr align 8 %c, i8 0, i64 12, i1 false)
19 define void @t2() nounwind ssp {
22 ; CHECK-7A: vmov.i32 {{q[0-9]+}}, #0x0
23 ; CHECK-7A: movs r1, #10
24 ; CHECK-7A: vst1.64 {d{{[0-9]+}}, d{{[0-9]+}}}, [r2], r1
25 ; CHECK-7A: vst1.16 {d{{[0-9]+}}, d{{[0-9]+}}}, [r2]
27 ; CHECK-6M: movs [[REG:r[0-9]+]], #0
28 ; CHECK-6M-DAG: str [[REG]], [sp, #20]
29 ; CHECK-6M-DAG: str [[REG]], [sp, #16]
30 ; CHECK-6M-DAG: str [[REG]], [sp, #12]
31 ; CHECK-6M-DAG: str [[REG]], [sp, #8]
32 ; CHECK-6M-DAG: str [[REG]], [sp, #4]
33 ; CHECK-6M-DAG: str [[REG]], [sp]
34 %buf = alloca [26 x i8], align 1
35 call void @llvm.memset.p0.i32(ptr %buf, i8 0, i32 26, i1 false)
36 call void @something(ptr %buf) nounwind
40 define void @t3(ptr %p) {
43 ; CHECK-7A: muls [[REG:r[0-9]+]],
44 ; CHECK-7A: str [[REG]],
47 ; CHECK-6M: strb [[REG:r[0-9]+]],
48 ; CHECK-6M: strb [[REG]],
49 ; CHECK-6M: strb [[REG]],
50 ; CHECK-6M: strb [[REG]],
54 %i = phi i32 [ 0, %entry ], [ %inc, %for.body ]
55 %0 = trunc i32 %i to i8
56 call void @llvm.memset.p0.i32(ptr %p, i8 %0, i32 4, i1 false)
57 call void @something(ptr %p)
58 %inc = add nuw nsw i32 %i, 1
59 %exitcond = icmp eq i32 %inc, 255
60 br i1 %exitcond, label %for.end, label %for.body
66 define void @t4(ptr %p) {
69 ; CHECK-7A: muls [[REG:r[0-9]+]],
70 ; CHECK-7A: str [[REG]],
72 ; CHECK-6M: muls [[REG:r[0-9]+]],
73 ; CHECK-6M: strh [[REG]],
74 ; CHECK-6M: strh [[REG]],
78 %i = phi i32 [ 0, %entry ], [ %inc, %for.body ]
79 %0 = trunc i32 %i to i8
80 call void @llvm.memset.p0.i32(ptr align 2 %p, i8 %0, i32 4, i1 false)
81 call void @something(ptr %p)
82 %inc = add nuw nsw i32 %i, 1
83 %exitcond = icmp eq i32 %inc, 255
84 br i1 %exitcond, label %for.end, label %for.body
90 declare void @something(ptr) nounwind
91 declare void @llvm.memset.p0.i32(ptr nocapture, i8, i32, i1) nounwind
92 declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i1) nounwind