| OLD | NEW |
| 1 ; Simple test of the select instruction. The CHECK lines are only | 1 ; Simple test of the select instruction. The CHECK lines are only |
| 2 ; checking for basic instruction patterns that should be present | 2 ; checking for basic instruction patterns that should be present |
| 3 ; regardless of the optimization level, so there are no special OPTM1 | 3 ; regardless of the optimization level, so there are no special OPTM1 |
| 4 ; match lines. | 4 ; match lines. |
| 5 | 5 |
| 6 ; RUN: %p2i -i %s --assemble --disassemble --args -O2 --verbose none \ | 6 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 | FileCheck %s |
| 7 ; RUN: | FileCheck %s | 7 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 | FileCheck %s |
| 8 ; RUN: %p2i -i %s --assemble --disassemble --args -Om1 --verbose none \ | |
| 9 ; RUN: | FileCheck %s | |
| 10 | 8 |
| 11 define void @testSelect(i32 %a, i32 %b) { | 9 define void @testSelect(i32 %a, i32 %b) { |
| 12 entry: | 10 entry: |
| 13 %cmp = icmp slt i32 %a, %b | 11 %cmp = icmp slt i32 %a, %b |
| 14 %cond = select i1 %cmp, i32 %a, i32 %b | 12 %cond = select i1 %cmp, i32 %a, i32 %b |
| 15 tail call void @useInt(i32 %cond) | 13 tail call void @useInt(i32 %cond) |
| 16 %cmp1 = icmp sgt i32 %a, %b | 14 %cmp1 = icmp sgt i32 %a, %b |
| 17 %cond2 = select i1 %cmp1, i32 10, i32 20 | 15 %cond2 = select i1 %cmp1, i32 10, i32 20 |
| 18 tail call void @useInt(i32 %cond2) | 16 tail call void @useInt(i32 %cond2) |
| 19 ret void | 17 ret void |
| (...skipping 23 matching lines...) Expand all Loading... |
| 43 ; Check for valid addressing mode in the cmp instruction when the | 41 ; Check for valid addressing mode in the cmp instruction when the |
| 44 ; operand is an immediate. There is a different x86-32 lowering | 42 ; operand is an immediate. There is a different x86-32 lowering |
| 45 ; sequence for 64-bit operands. | 43 ; sequence for 64-bit operands. |
| 46 define i64 @testSelectImm64(i64 %a, i64 %b) { | 44 define i64 @testSelectImm64(i64 %a, i64 %b) { |
| 47 entry: | 45 entry: |
| 48 %cond = select i1 true, i64 %a, i64 %b | 46 %cond = select i1 true, i64 %a, i64 %b |
| 49 ret i64 %cond | 47 ret i64 %cond |
| 50 } | 48 } |
| 51 ; CHECK-LABEL: testSelectImm64 | 49 ; CHECK-LABEL: testSelectImm64 |
| 52 ; CHECK-NOT: cmp 0x{{[0-9a-f]+}}, | 50 ; CHECK-NOT: cmp 0x{{[0-9a-f]+}}, |
| OLD | NEW |