OLD | NEW |
1 ; Simple test of non-fused compare/branch. | 1 ; Simple test of non-fused compare/branch. |
2 | 2 |
3 ; RUN: %llvm2ice -O2 --verbose none %s | FileCheck %s | 3 ; RUN: %llvm2ice -O2 --verbose none %s | FileCheck %s |
4 ; RUN: %llvm2ice -Om1 --verbose none %s | FileCheck --check-prefix=OPTM1 %s | 4 ; RUN: %llvm2ice -Om1 --verbose none %s | FileCheck --check-prefix=OPTM1 %s |
5 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s | 5 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s |
6 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s | 6 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s |
7 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \ | 7 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \ |
8 ; RUN: | FileCheck --check-prefix=DUMP %s | 8 ; RUN: | FileCheck --check-prefix=DUMP %s |
9 | 9 |
10 define void @testBool(i32 %a, i32 %b) { | 10 define void @testBool(i32 %a, i32 %b) { |
11 entry: | 11 entry: |
12 %cmp = icmp slt i32 %a, %b | 12 %cmp = icmp slt i32 %a, %b |
13 %cmp1 = icmp sgt i32 %a, %b | 13 %cmp1 = icmp sgt i32 %a, %b |
14 br i1 %cmp, label %if.then, label %if.end | 14 br i1 %cmp, label %if.then, label %if.end |
15 | 15 |
16 if.then: ; preds = %entry | 16 if.then: ; preds = %entry |
17 tail call void @use(i1 %cmp) | 17 %cmp_ext = zext i1 %cmp to i32 |
| 18 tail call void @use(i32 %cmp_ext) |
18 br label %if.end | 19 br label %if.end |
19 | 20 |
20 if.end: ; preds = %if.then, %entry | 21 if.end: ; preds = %if.then, %entry |
21 br i1 %cmp1, label %if.then5, label %if.end7 | 22 br i1 %cmp1, label %if.then5, label %if.end7 |
22 | 23 |
23 if.then5: ; preds = %if.end | 24 if.then5: ; preds = %if.end |
24 tail call void @use(i1 %cmp1) | 25 %cmp1_ext = zext i1 %cmp1 to i32 |
| 26 tail call void @use(i32 %cmp1_ext) |
25 br label %if.end7 | 27 br label %if.end7 |
26 | 28 |
27 if.end7: ; preds = %if.then5, %if.end | 29 if.end7: ; preds = %if.then5, %if.end |
28 ret void | 30 ret void |
29 } | 31 } |
30 | 32 |
31 declare void @use(i1 zeroext) | 33 declare void @use(i32) |
32 | 34 |
33 ; CHECK: .globl testBool | 35 ; CHECK: .globl testBool |
34 ; Two bool computations | 36 ; Two bool computations |
35 ; CHECK: cmp | 37 ; CHECK: cmp |
36 ; CHECK: cmp | 38 ; CHECK: cmp |
37 ; Test first bool | 39 ; Test first bool |
38 ; CHECK: cmp | 40 ; CHECK: cmp |
39 ; CHECK: call | 41 ; CHECK: call |
40 ; Test second bool | 42 ; Test second bool |
41 ; CHECK: cmp | 43 ; CHECK: cmp |
42 ; CHECK: call | 44 ; CHECK: call |
43 ; CHECK: ret | 45 ; CHECK: ret |
44 ; | 46 ; |
45 ; OPTM1: .globl testBool | 47 ; OPTM1: .globl testBool |
46 ; Two bool computations | 48 ; Two bool computations |
47 ; OPTM1: cmp | 49 ; OPTM1: cmp |
48 ; OPTM1: cmp | 50 ; OPTM1: cmp |
49 ; Test first bool | 51 ; Test first bool |
50 ; OPTM1: cmp | 52 ; OPTM1: cmp |
51 ; OPTM1: call | 53 ; OPTM1: call |
52 ; Test second bool | 54 ; Test second bool |
53 ; OPTM1: cmp | 55 ; OPTM1: cmp |
54 ; OPTM1: call | 56 ; OPTM1: call |
55 ; OPTM1: ret | 57 ; OPTM1: ret |
56 | 58 |
57 ; ERRORS-NOT: ICE translation error | 59 ; ERRORS-NOT: ICE translation error |
58 ; DUMP-NOT: SZ | 60 ; DUMP-NOT: SZ |
OLD | NEW |