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