OLD | NEW |
1 ; This tests some of the subtleties of Phi lowering. In particular, | 1 ; This tests some of the subtleties of Phi lowering. In particular, |
2 ; it tests that it does the right thing when it tries to enable | 2 ; it tests that it does the right thing when it tries to enable |
3 ; compare/branch fusing. | 3 ; compare/branch fusing. |
4 | 4 |
5 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 --phi-edge-split=0 \ | 5 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 --phi-edge-split=0 \ |
6 ; RUN: | FileCheck %s | 6 ; RUN: | FileCheck %s |
7 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 --phi-edge-split=1 \ | 7 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 --phi-edge-split=1 \ |
8 ; RUN: | FileCheck --check-prefix=SPLIT %s | 8 ; RUN: | FileCheck --check-prefix=SPLIT %s |
9 | 9 |
10 define internal i32 @testPhi1(i32 %arg) { | 10 define internal i32 @testPhi1(i32 %arg) { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 ; .LtestPhi3$exit: | 85 ; .LtestPhi3$exit: |
86 ; mov DWORD PTR [ecx+1000], eax | 86 ; mov DWORD PTR [ecx+1000], eax |
87 ; ret | 87 ; ret |
88 ; | 88 ; |
89 ; This is bad because the final store address is supposed to be the | 89 ; This is bad because the final store address is supposed to be the |
90 ; same as the load address in the loop, but it has clearly been | 90 ; same as the load address in the loop, but it has clearly been |
91 ; over-optimized into a null pointer dereference. | 91 ; over-optimized into a null pointer dereference. |
92 | 92 |
93 ; CHECK-LABEL: testPhi3 | 93 ; CHECK-LABEL: testPhi3 |
94 ; CHECK: push [[EBX:.*]] | 94 ; CHECK: push [[EBX:.*]] |
95 ; CHECK: mov {{.*}},DWORD PTR [esp | 95 ; CHECK: mov [[EAX:.*]],DWORD PTR [esp |
96 ; CHECK: mov | 96 ; CHECK: mov [[ECX:.*]],[[EAX]] |
97 ; CHECK: mov {{.*}},DWORD PTR [[ADDR:.*0x3e8]] | 97 ;;; start of loop body |
| 98 ; CHECK: mov [[EDX:.*]],[[ECX]] |
| 99 ; CHECK: mov {{.*}},DWORD PTR [{{.*}}+0x3e8] |
98 ; CHECK: cmp {{.*}},0x0 | 100 ; CHECK: cmp {{.*}},0x0 |
99 ; CHECK: jne | 101 ; CHECK: jne |
100 ; CHECK: mov DWORD PTR [[ADDR]] | 102 ;;; start of epilog |
| 103 ; CHECK: mov DWORD PTR {{.}}[[EDX]]+0x3e8], |
101 ; CHECK: pop [[EBX]] | 104 ; CHECK: pop [[EBX]] |
102 | 105 |
103 ; Test of "advanced phi lowering" with undef phi arg (integer vector). | 106 ; Test of "advanced phi lowering" with undef phi arg (integer vector). |
104 define internal <4 x i32> @test_split_undef_int_vec(<4 x i32> %arg, i32 %cond) { | 107 define internal <4 x i32> @test_split_undef_int_vec(<4 x i32> %arg, i32 %cond) { |
105 entry: | 108 entry: |
106 %cmp = icmp eq i32 %cond, 0 | 109 %cmp = icmp eq i32 %cond, 0 |
107 br i1 %cmp, label %eq, label %exit | 110 br i1 %cmp, label %eq, label %exit |
108 eq: | 111 eq: |
109 br label %exit | 112 br label %exit |
110 exit: | 113 exit: |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 %cmp = icmp eq i32 %cond, 0 | 151 %cmp = icmp eq i32 %cond, 0 |
149 br i1 %cmp, label %eq, label %exit | 152 br i1 %cmp, label %eq, label %exit |
150 eq: | 153 eq: |
151 br label %exit | 154 br label %exit |
152 exit: | 155 exit: |
153 %merge = phi float [ %arg, %entry ], [ undef, %eq ] | 156 %merge = phi float [ %arg, %entry ], [ undef, %eq ] |
154 ret float %merge | 157 ret float %merge |
155 } | 158 } |
156 ; SPLIT-LABEL: test_split_undef_float_scalar | 159 ; SPLIT-LABEL: test_split_undef_float_scalar |
157 ; SPLIT: movss {{.*}},DWORD PTR | 160 ; SPLIT: movss {{.*}},DWORD PTR |
OLD | NEW |