OLD | NEW |
1 ; RUN: llc < %s -mtriple=x86_64-linux -O0 | FileCheck %s --check-prefix=X64 | 1 ; RUN: llc < %s -mtriple=x86_64-linux -O0 | FileCheck %s --check-prefix=X64 |
2 ; RUN: llc < %s -mtriple=x86_64-win32 -O0 | FileCheck %s --check-prefix=X64 | 2 ; RUN: llc < %s -mtriple=x86_64-win32 -O0 | FileCheck %s --check-prefix=X64 |
3 ; RUN: llc < %s -march=x86 -O0 | FileCheck %s --check-prefix=X32 | 3 ; RUN: llc < %s -march=x86 -O0 | FileCheck %s --check-prefix=X32 |
| 4 ; @LOCALMOD-BEGIN |
| 5 ; RUN: pnacl-llc < %s -mtriple=i686-nacl -march=x86 -O0 | FileCheck %s --check-p
refix=NACL32 |
| 6 ; @LOCALMOD-END |
4 | 7 |
5 ; GEP indices are interpreted as signed integers, so they | 8 ; GEP indices are interpreted as signed integers, so they |
6 ; should be sign-extended to 64 bits on 64-bit targets. | 9 ; should be sign-extended to 64 bits on 64-bit targets. |
7 ; PR3181 | 10 ; PR3181 |
8 define i32 @test1(i32 %t3, i32* %t1) nounwind { | 11 define i32 @test1(i32 %t3, i32* %t1) nounwind { |
9 %t9 = getelementptr i32* %t1, i32 %t3 ; <i32*> [#uses=1] | 12 %t9 = getelementptr i32* %t1, i32 %t3 ; <i32*> [#uses=1] |
10 %t15 = load i32* %t9 ; <i32> [#uses=1] | 13 %t15 = load i32* %t9 ; <i32> [#uses=1] |
11 ret i32 %t15 | 14 ret i32 %t15 |
12 ; X32-LABEL: test1: | 15 ; X32-LABEL: test1: |
13 ; X32: movl (%eax,%ecx,4), %eax | 16 ; X32: movl (%eax,%ecx,4), %eax |
14 ; X32: ret | 17 ; X32: ret |
15 | 18 |
16 ; X64-LABEL: test1: | 19 ; X64-LABEL: test1: |
17 ; X64: movslq %e[[A0:di|cx]], %rax | 20 ; X64: movslq %e[[A0:di|cx]], %rax |
18 ; X64: movl (%r[[A1:si|dx]],%rax,4), %eax | 21 ; X64: movl (%r[[A1:si|dx]],%rax,4), %eax |
19 ; X64: ret | 22 ; X64: ret |
20 | 23 |
| 24 ; @LOCALMOD-BEGIN |
| 25 ; NACL32: test1: |
| 26 ; NACL32: movl (%e{{.*}},%e{{.*}},4), %eax |
| 27 ; NACL32: popl %ecx |
| 28 ; NACL32: nacljmp %ecx |
| 29 ; @LOCALMOD-END |
| 30 |
21 } | 31 } |
22 define i32 @test2(i64 %t3, i32* %t1) nounwind { | 32 define i32 @test2(i64 %t3, i32* %t1) nounwind { |
23 %t9 = getelementptr i32* %t1, i64 %t3 ; <i32*> [#uses=1] | 33 %t9 = getelementptr i32* %t1, i64 %t3 ; <i32*> [#uses=1] |
24 %t15 = load i32* %t9 ; <i32> [#uses=1] | 34 %t15 = load i32* %t9 ; <i32> [#uses=1] |
25 ret i32 %t15 | 35 ret i32 %t15 |
26 ; X32-LABEL: test2: | 36 ; X32-LABEL: test2: |
27 ; X32: movl (%edx,%ecx,4), %e | 37 ; X32: movl (%edx,%ecx,4), %e |
28 ; X32: ret | 38 ; X32: ret |
29 | 39 |
30 ; X64-LABEL: test2: | 40 ; X64-LABEL: test2: |
31 ; X64: movl (%r[[A1]],%r[[A0]],4), %eax | 41 ; X64: movl (%r[[A1]],%r[[A0]],4), %eax |
32 ; X64: ret | 42 ; X64: ret |
| 43 |
| 44 ; @LOCALMOD-BEGIN |
| 45 ; NACL32: test2: |
| 46 ; NACL32: movl (%e{{.*}},%e{{.*}},4), %e |
| 47 ; @LOCALMOD-END |
| 48 |
33 } | 49 } |
34 | 50 |
35 | 51 |
36 | 52 |
37 ; PR4984 | 53 ; PR4984 |
38 define i8 @test3(i8* %start) nounwind { | 54 define i8 @test3(i8* %start) nounwind { |
39 entry: | 55 entry: |
40 %A = getelementptr i8* %start, i64 -2 ; <i8*> [#uses=1] | 56 %A = getelementptr i8* %start, i64 -2 ; <i8*> [#uses=1] |
41 %B = load i8* %A, align 1 ; <i8> [#uses=1] | 57 %B = load i8* %A, align 1 ; <i8> [#uses=1] |
42 ret i8 %B | 58 ret i8 %B |
43 | 59 |
44 | 60 |
45 ; X32-LABEL: test3: | 61 ; X32-LABEL: test3: |
46 ; X32: movl 4(%esp), %eax | 62 ; X32: movl 4(%esp), %eax |
47 ; X32: movb -2(%eax), %al | 63 ; X32: movb -2(%eax), %al |
48 ; X32: ret | 64 ; X32: ret |
49 | 65 |
50 ; X64-LABEL: test3: | 66 ; X64-LABEL: test3: |
51 ; X64: movb -2(%r[[A0]]), %al | 67 ; X64: movb -2(%r[[A0]]), %al |
52 ; X64: ret | 68 ; X64: ret |
53 | 69 |
| 70 ; @LOCALMOD-BEGIN |
| 71 ; NACL32: test3: |
| 72 ; NACL32: movl 4(%esp), %[[REG:e..]] |
| 73 ; NACL32: movb -2(%{{.*}}[[REG]]), %al |
| 74 ; @LOCALMOD-END |
| 75 |
54 } | 76 } |
55 | 77 |
56 define double @test4(i64 %x, double* %p) nounwind { | 78 define double @test4(i64 %x, double* %p) nounwind { |
57 entry: | 79 entry: |
58 %x.addr = alloca i64, align 8 ; <i64*> [#uses=2] | 80 %x.addr = alloca i64, align 8 ; <i64*> [#uses=2] |
59 %p.addr = alloca double*, align 8 ; <double**> [#uses=2] | 81 %p.addr = alloca double*, align 8 ; <double**> [#uses=2] |
60 store i64 %x, i64* %x.addr | 82 store i64 %x, i64* %x.addr |
61 store double* %p, double** %p.addr | 83 store double* %p, double** %p.addr |
62 %tmp = load i64* %x.addr ; <i64> [#uses=1] | 84 %tmp = load i64* %x.addr ; <i64> [#uses=1] |
63 %add = add nsw i64 %tmp, 16 ; <i64> [#uses=1] | 85 %add = add nsw i64 %tmp, 16 ; <i64> [#uses=1] |
64 %tmp1 = load double** %p.addr ; <double*> [#uses=1] | 86 %tmp1 = load double** %p.addr ; <double*> [#uses=1] |
65 %arrayidx = getelementptr inbounds double* %tmp1, i64 %add ; <double*> [#uses=
1] | 87 %arrayidx = getelementptr inbounds double* %tmp1, i64 %add ; <double*> [#uses=
1] |
66 %tmp2 = load double* %arrayidx ; <double> [#uses=1] | 88 %tmp2 = load double* %arrayidx ; <double> [#uses=1] |
67 ret double %tmp2 | 89 ret double %tmp2 |
68 | 90 |
69 ; X32-LABEL: test4: | 91 ; X32-LABEL: test4: |
70 ; X32: 128(%e{{.*}},%e{{.*}},8) | 92 ; X32: 128(%e{{.*}},%e{{.*}},8) |
71 ; X64-LABEL: test4: | 93 ; X64-LABEL: test4: |
72 ; X64: 128(%r{{.*}},%r{{.*}},8) | 94 ; X64: 128(%r{{.*}},%r{{.*}},8) |
| 95 ; @LOCALMOD-BEGIN |
| 96 ; NACL32: test4: |
| 97 ; NACL32: 128(%e{{.*}},%e{{.*}},8) |
| 98 ; @LOCALMOD-END |
73 } | 99 } |
74 | 100 |
75 ; PR8961 - Make sure the sext for the GEP addressing comes before the load that | 101 ; PR8961 - Make sure the sext for the GEP addressing comes before the load that |
76 ; is folded. | 102 ; is folded. |
77 define i64 @test5(i8* %A, i32 %I, i64 %B) nounwind { | 103 define i64 @test5(i8* %A, i32 %I, i64 %B) nounwind { |
78 %v8 = getelementptr i8* %A, i32 %I | 104 %v8 = getelementptr i8* %A, i32 %I |
79 %v9 = bitcast i8* %v8 to i64* | 105 %v9 = bitcast i8* %v8 to i64* |
80 %v10 = load i64* %v9 | 106 %v10 = load i64* %v9 |
81 %v11 = add i64 %B, %v10 | 107 %v11 = add i64 %B, %v10 |
82 ret i64 %v11 | 108 ret i64 %v11 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 br i1 %tmp73, label %T, label %F | 155 br i1 %tmp73, label %T, label %F |
130 | 156 |
131 T: | 157 T: |
132 ret i32 %tmp72 | 158 ret i32 %tmp72 |
133 | 159 |
134 F: | 160 F: |
135 ret i32 4 | 161 ret i32 4 |
136 } | 162 } |
137 | 163 |
138 declare i32 @__gxx_personality_v0(...) | 164 declare i32 @__gxx_personality_v0(...) |
OLD | NEW |