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

Side by Side Diff: tests_lit/llvm2ice_tests/adv-switch-opt.ll

Issue 1246173003: Remove jumps over empty blocks. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Warning in comment. Created 5 years, 5 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
OLDNEW
1 ; This tests the advanced lowering of switch statements. The advanced lowering 1 ; This tests the advanced lowering of switch statements. The advanced lowering
2 ; uses jump tables, range tests and binary search. 2 ; uses jump tables, range tests and binary search.
3 3
4 ; RUN: %if --need=allow_dump --command %p2i -i %s --filetype=asm --assemble \ 4 ; RUN: %if --need=allow_dump --command %p2i -i %s --filetype=asm --assemble \
5 ; RUN: --disassemble --args --adv-switch -O2 | FileCheck %s 5 ; RUN: --disassemble --args --adv-switch -O2 | FileCheck %s
6 6
7 ; Dense but non-continuous ranges should be converted into a jump table. 7 ; Dense but non-continuous ranges should be converted into a jump table.
8 define internal i32 @testJumpTable(i32 %a) { 8 define internal i32 @testJumpTable(i32 %a) {
9 entry: 9 entry:
10 switch i32 %a, label %sw.default [ 10 switch i32 %a, label %sw.default [
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 ; CHECK-NEXT: cmp {{.*}},0x159 136 ; CHECK-NEXT: cmp {{.*}},0x159
137 ; CHECK-NEXT: jb 137 ; CHECK-NEXT: jb
138 ; CHECK-NEXT: je 138 ; CHECK-NEXT: je
139 ; CHECK-NEXT: cmp {{.*}},0x1c8 139 ; CHECK-NEXT: cmp {{.*}},0x1c8
140 ; CHECK-NEXT: je 140 ; CHECK-NEXT: je
141 ; CHECK-NEXT: jmp 141 ; CHECK-NEXT: jmp
142 ; CHECK-NEXT: cmp {{.*}},0x7b 142 ; CHECK-NEXT: cmp {{.*}},0x7b
143 ; CHECK-NEXT: je 143 ; CHECK-NEXT: je
144 ; CHECK-NEXT: cmp {{.*}},0xea 144 ; CHECK-NEXT: cmp {{.*}},0xea
145 ; CHECK-NEXT: je 145 ; CHECK-NEXT: je
146 ; CHECK-NEXT: jmp
147 146
148 ; Test for correct 64-bit lowering. 147 ; Test for correct 64-bit lowering.
149 ; TODO(ascull): this should generate better code like the 32-bit version 148 ; TODO(ascull): this should generate better code like the 32-bit version
150 define internal i32 @testSwitch64(i64 %a) { 149 define internal i32 @testSwitch64(i64 %a) {
151 entry: 150 entry:
152 switch i64 %a, label %sw.default [ 151 switch i64 %a, label %sw.default [
153 i64 123, label %return 152 i64 123, label %return
154 i64 234, label %sw.bb1 153 i64 234, label %sw.bb1
155 i64 345, label %sw.bb2 154 i64 345, label %sw.bb2
156 i64 78187493520, label %sw.bb3 155 i64 78187493520, label %sw.bb3
(...skipping 25 matching lines...) Expand all
182 ; CHECK-NEXT: cmp {{.*}},0x0 181 ; CHECK-NEXT: cmp {{.*}},0x0
183 ; CHECK-NEXT: je 182 ; CHECK-NEXT: je
184 ; CHECK: cmp {{.*}},0x159 183 ; CHECK: cmp {{.*}},0x159
185 ; CHECK-NEXT: jne 184 ; CHECK-NEXT: jne
186 ; CHECK-NEXT: cmp {{.*}},0x0 185 ; CHECK-NEXT: cmp {{.*}},0x0
187 ; CHECK-NEXT: je 186 ; CHECK-NEXT: je
188 ; CHECK: cmp {{.*}},0x34567890 187 ; CHECK: cmp {{.*}},0x34567890
189 ; CHECK-NEXT: jne 188 ; CHECK-NEXT: jne
190 ; CHECK-NEXT: cmp {{.*}},0x12 189 ; CHECK-NEXT: cmp {{.*}},0x12
191 ; CHECK-NEXT: je 190 ; CHECK-NEXT: je
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698