1 ; RUN: llc < %s -mtriple=thumbv7-apple-ios -mattr=+thumb2 | FileCheck %s -check-prefix=ALL -check-prefix=CHECK
2 ; RUN: llc < %s -mtriple=thumbv7-apple-ios -mattr=+thumb2 -arm-assume-misaligned-load-store | FileCheck %s -check-prefix=ALL -check-prefix=CONSERVATIVE
4 @X = external global [0 x i32] ; <[0 x i32]*> [#uses=5]
6 define i32 @t1() "no-frame-pointer-elim"="true" {
10 ; CONSERVATIVE-NOT: ldrd
11 ; CONSERVATIVE-NOT: ldm
13 %tmp = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 0) ; <i32> [#uses=1]
14 %tmp3 = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 1) ; <i32> [#uses=1]
15 %tmp4 = call i32 @f1( i32 %tmp, i32 %tmp3 ) ; <i32> [#uses=1]
19 define i32 @t2() "no-frame-pointer-elim"="true" {
23 ; CONSERVATIVE-NOT: ldrd
24 ; CONSERVATIVE-NOT: ldm
26 %tmp = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 2) ; <i32> [#uses=1]
27 %tmp3 = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 3) ; <i32> [#uses=1]
28 %tmp5 = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 4) ; <i32> [#uses=1]
29 %tmp6 = call i32 @f2( i32 %tmp, i32 %tmp3, i32 %tmp5 ) ; <i32> [#uses=1]
33 define i32 @t3() "no-frame-pointer-elim"="true" {
37 ; CONSERVATIVE-NOT: ldrd
38 ; CONSERVATIVE-NOT: ldm
40 %tmp = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 1) ; <i32> [#uses=1]
41 %tmp3 = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 2) ; <i32> [#uses=1]
42 %tmp5 = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 3) ; <i32> [#uses=1]
43 %tmp6 = call i32 @f2( i32 %tmp, i32 %tmp3, i32 %tmp5 ) ; <i32> [#uses=1]
47 @g = common global i32* null
49 define void @t4(i32 %a0, i32 %a1, i32 %a2) "no-frame-pointer-elim"="true" {
51 ; ALL: stm.w sp, {r0, r1, r2}
53 ; ALL: ldm.w sp, {r0, r1, r2}
55 %arr = alloca [4 x i32], align 4
56 %p0 = getelementptr inbounds [4 x i32], [4 x i32]* %arr, i64 0, i64 0
57 %p1 = getelementptr inbounds [4 x i32], [4 x i32]* %arr, i64 0, i64 1
58 %p2 = getelementptr inbounds [4 x i32], [4 x i32]* %arr, i64 0, i64 2
59 store i32* %p0, i32** @g, align 8
61 store i32 %a0, i32* %p0, align 4
62 store i32 %a1, i32* %p1, align 4
63 store i32 %a2, i32* %p2, align 4
66 %v0 = load i32, i32* %p0, align 4
67 %v1 = load i32, i32* %p1, align 4
68 %v2 = load i32, i32* %p2, align 4
69 call i32 @f2(i32 %v0, i32 %v1, i32 %v2)
73 declare i32 @f1(i32, i32)
75 declare i32 @f2(i32, i32, i32)