Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Side by Side Diff: tests_lit/llvm2ice_tests/cmp-opt.ll

Issue 339933004: Change some tests to be valid PNaCl IR (parameter type from i1 -> i32). (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests_lit/llvm2ice_tests/bool-opt.ll ('k') | tests_lit/llvm2ice_tests/fp.pnacl.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
OLDNEW
« no previous file with comments | « tests_lit/llvm2ice_tests/bool-opt.ll ('k') | tests_lit/llvm2ice_tests/fp.pnacl.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698