comparison test/CodeGen/Thumb2/thumb2-ldm.ll @ 120:1172e4bd9c6f

update 4.0.0
author mir3636
date Fri, 25 Nov 2016 19:14:25 +0900
parents afa8332a0e37
children
comparison
equal deleted inserted replaced
101:34baf5011add 120:1172e4bd9c6f
1 ; RUN: llc < %s -mtriple=thumbv7-apple-ios -mattr=+thumb2 | FileCheck %s 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
2 3
3 @X = external global [0 x i32] ; <[0 x i32]*> [#uses=5] 4 @X = external global [0 x i32] ; <[0 x i32]*> [#uses=5]
4 5
5 define i32 @t1() { 6 define i32 @t1() "no-frame-pointer-elim"="true" {
6 ; CHECK-LABEL: t1: 7 ; ALL-LABEL: t1:
7 ; CHECK: push {r7, lr} 8 ; ALL: push {r7, lr}
8 ; CHECK: ldrd 9 ; CHECK: ldrd
9 ; CHECK: pop {r7, pc} 10 ; CONSERVATIVE-NOT: ldrd
11 ; CONSERVATIVE-NOT: ldm
12 ; ALL: pop {r7, pc}
10 %tmp = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 0) ; <i32> [#uses=1] 13 %tmp = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 0) ; <i32> [#uses=1]
11 %tmp3 = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 1) ; <i32> [#uses=1] 14 %tmp3 = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 1) ; <i32> [#uses=1]
12 %tmp4 = call i32 @f1( i32 %tmp, i32 %tmp3 ) ; <i32> [#uses=1] 15 %tmp4 = call i32 @f1( i32 %tmp, i32 %tmp3 ) ; <i32> [#uses=1]
13 ret i32 %tmp4 16 ret i32 %tmp4
14 } 17 }
15 18
16 define i32 @t2() { 19 define i32 @t2() "no-frame-pointer-elim"="true" {
17 ; CHECK-LABEL: t2: 20 ; ALL-LABEL: t2:
18 ; CHECK: push {r7, lr} 21 ; ALL: push {r7, lr}
19 ; CHECK: ldm 22 ; CHECK: ldm
20 ; CHECK: pop {r7, pc} 23 ; CONSERVATIVE-NOT: ldrd
24 ; CONSERVATIVE-NOT: ldm
25 ; ALL: pop {r7, pc}
21 %tmp = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 2) ; <i32> [#uses=1] 26 %tmp = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 2) ; <i32> [#uses=1]
22 %tmp3 = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 3) ; <i32> [#uses=1] 27 %tmp3 = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 3) ; <i32> [#uses=1]
23 %tmp5 = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 4) ; <i32> [#uses=1] 28 %tmp5 = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 4) ; <i32> [#uses=1]
24 %tmp6 = call i32 @f2( i32 %tmp, i32 %tmp3, i32 %tmp5 ) ; <i32> [#uses=1] 29 %tmp6 = call i32 @f2( i32 %tmp, i32 %tmp3, i32 %tmp5 ) ; <i32> [#uses=1]
25 ret i32 %tmp6 30 ret i32 %tmp6
26 } 31 }
27 32
28 define i32 @t3() { 33 define i32 @t3() "no-frame-pointer-elim"="true" {
29 ; CHECK-LABEL: t3: 34 ; ALL-LABEL: t3:
30 ; CHECK: push {r7, lr} 35 ; ALL: push {r7, lr}
31 ; CHECK: ldm 36 ; CHECK: ldm
32 ; CHECK: pop {r7, pc} 37 ; CONSERVATIVE-NOT: ldrd
38 ; CONSERVATIVE-NOT: ldm
39 ; ALL: pop {r7, pc}
33 %tmp = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 1) ; <i32> [#uses=1] 40 %tmp = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 1) ; <i32> [#uses=1]
34 %tmp3 = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 2) ; <i32> [#uses=1] 41 %tmp3 = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 2) ; <i32> [#uses=1]
35 %tmp5 = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 3) ; <i32> [#uses=1] 42 %tmp5 = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @X, i32 0, i32 3) ; <i32> [#uses=1]
36 %tmp6 = call i32 @f2( i32 %tmp, i32 %tmp3, i32 %tmp5 ) ; <i32> [#uses=1] 43 %tmp6 = call i32 @f2( i32 %tmp, i32 %tmp3, i32 %tmp5 ) ; <i32> [#uses=1]
37 ret i32 %tmp6 44 ret i32 %tmp6
38 } 45 }
39 46
47 @g = common global i32* null
48
49 define void @t4(i32 %a0, i32 %a1, i32 %a2) "no-frame-pointer-elim"="true" {
50 ; ALL-LABEL: t4:
51 ; ALL: stm.w sp, {r0, r1, r2}
52 ; ALL: bl _ext
53 ; ALL: ldm.w sp, {r0, r1, r2}
54 ; ALL: bl _f2
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
60
61 store i32 %a0, i32* %p0, align 4
62 store i32 %a1, i32* %p1, align 4
63 store i32 %a2, i32* %p2, align 4
64 call void @ext()
65
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)
70 ret void
71 }
72
40 declare i32 @f1(i32, i32) 73 declare i32 @f1(i32, i32)
41 74
42 declare i32 @f2(i32, i32, i32) 75 declare i32 @f2(i32, i32, i32)
76
77 declare void @ext()