OLD | NEW |
1 ; This tests the optimization where producers and consumers of i1 (bool) | 1 ; This tests the optimization where producers and consumers of i1 (bool) |
2 ; variables are combined to implicitly use flags instead of explicitly using | 2 ; variables are combined to implicitly use flags instead of explicitly using |
3 ; stack or register variables. | 3 ; stack or register variables. |
4 | 4 |
5 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \ | 5 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \ |
6 ; RUN: -allow-externally-defined-symbols | FileCheck %s | 6 ; RUN: -allow-externally-defined-symbols | FileCheck %s |
7 | 7 |
8 ; RUN: %if --need=allow_dump --need=target_ARM32 --command %p2i --filetype=asm \ | 8 ; RUN: %if --need=allow_dump --need=target_ARM32 --command %p2i --filetype=asm \ |
9 ; RUN: --target arm32 -i %s --args -O2 --skip-unimplemented \ | 9 ; RUN: --target arm32 -i %s --args -O2 --skip-unimplemented \ |
10 ; RUN: -allow-externally-defined-symbols \ | 10 ; RUN: -allow-externally-defined-symbols \ |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 %cmp1 = icmp slt i32 undef, %arg1_trunc | 162 %cmp1 = icmp slt i32 undef, %arg1_trunc |
163 %result = select i1 %cmp1, i64 %arg1, i64 undef | 163 %result = select i1 %cmp1, i64 %arg1, i64 undef |
164 ret i64 %result | 164 ret i64 %result |
165 } | 165 } |
166 ; CHECK-LABEL: fold_cmp_select_64_undef | 166 ; CHECK-LABEL: fold_cmp_select_64_undef |
167 ; CHECK: cmp | 167 ; CHECK: cmp |
168 ; CHECK: cmovl | 168 ; CHECK: cmovl |
169 ; CHECK: cmovl | 169 ; CHECK: cmovl |
170 ; ARM32-LABEL: fold_cmp_select_64_undef | 170 ; ARM32-LABEL: fold_cmp_select_64_undef |
171 ; ARM32: mov | 171 ; ARM32: mov |
172 ; ARM32: mov | 172 ; ARM32: rsbs r{{[0-9]+}}, r{{[0-9]+}}, #0 |
173 ; ARM32: cmp {{r[0-9]+}}, r0 | |
174 ; ARM32: movlt | 173 ; ARM32: movlt |
175 ; ARM32: movlt | 174 ; ARM32: movlt |
176 ; ARM32: bx lr | 175 ; ARM32: bx lr |
177 | 176 |
178 | 177 |
179 ; Cmp/select folding with intervening instructions. | 178 ; Cmp/select folding with intervening instructions. |
180 define internal i32 @fold_cmp_select_intervening_insts(i32 %arg1, i32 %arg2) { | 179 define internal i32 @fold_cmp_select_intervening_insts(i32 %arg1, i32 %arg2) { |
181 entry: | 180 entry: |
182 %cmp1 = icmp slt i32 %arg1, %arg2 | 181 %cmp1 = icmp slt i32 %arg1, %arg2 |
183 call void @use_value(i32 %arg1) | 182 call void @use_value(i32 %arg1) |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 ; ARM32: tst r0, #1 | 420 ; ARM32: tst r0, #1 |
422 ; ARM32: bne | 421 ; ARM32: bne |
423 ; ARM32: tst r1, #1 | 422 ; ARM32: tst r1, #1 |
424 ; ARM32: beq | 423 ; ARM32: beq |
425 ; ARM32: tst r2, #1 | 424 ; ARM32: tst r2, #1 |
426 ; ARM32: bne {{.*}}target_true | 425 ; ARM32: bne {{.*}}target_true |
427 ; ARM32: tst r3, #1 | 426 ; ARM32: tst r3, #1 |
428 ; ARM32: beq {{.*}}target_false | 427 ; ARM32: beq {{.*}}target_false |
429 ; ARM32: tst r4, #1 | 428 ; ARM32: tst r4, #1 |
430 ; ARM32: beq {{.*}}target_false | 429 ; ARM32: beq {{.*}}target_false |
OLD | NEW |