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

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

Issue 511543002: Subzero: Fix some legalization issues involving immediates. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes, first round Created 6 years, 3 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/select-opt.ll ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 ; This tests a switch statement, including multiple branches to the 1 ; This tests a switch statement, including multiple branches to the
2 ; same label which also results in phi instructions with multiple 2 ; same label which also results in phi instructions with multiple
3 ; entries for the same incoming edge. 3 ; entries for the same incoming edge.
4 4
5 ; RUN: %llvm2ice --verbose inst %s | FileCheck %s 5 ; RUN: %llvm2ice --verbose inst %s | FileCheck %s
6 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s 6 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s
7 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s 7 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s
8 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \ 8 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \
9 ; RUN: | FileCheck --check-prefix=DUMP %s 9 ; RUN: | FileCheck --check-prefix=DUMP %s
10 10
(...skipping 19 matching lines...) Expand all
30 30
31 sw.bb2: ; preds = %sw.bb1, %entry, %en try 31 sw.bb2: ; preds = %sw.bb1, %entry, %en try
32 %result.0 = phi i32 [ 1, %entry ], [ 1, %entry ], [ %phitmp, %sw.bb1 ] 32 %result.0 = phi i32 [ 1, %entry ], [ 1, %entry ], [ %phitmp, %sw.bb1 ]
33 br label %sw.epilog 33 br label %sw.epilog
34 34
35 sw.epilog: ; preds = %sw.bb2, %sw.default , %entry, %entry, %entry 35 sw.epilog: ; preds = %sw.bb2, %sw.default , %entry, %entry, %entry
36 %result.1 = phi i32 [ %add, %sw.default ], [ %result.0, %sw.bb2 ], [ 17, %entr y ], [ 17, %entry ], [ 17, %entry ] 36 %result.1 = phi i32 [ %add, %sw.default ], [ %result.0, %sw.bb2 ], [ 17, %entr y ], [ 17, %entry ], [ 17, %entry ]
37 ret i32 %result.1 37 ret i32 %result.1
38 } 38 }
39 39
40 ; Check for a valid addressing mode when the switch operand is an
41 ; immediate. It's important that there is exactly one case, because
42 ; for two or more cases the source operand is legalized into a
43 ; register.
44 define i32 @testSwitchImm() {
45 entry:
46 switch i32 10, label %sw.default [
47 i32 1, label %sw.default
48 ]
49
50 sw.default:
51 ret i32 20
52 }
53 ; CHECK-LABEL: testSwitchImm
54 ; CHECK-NOT: cmp {{[0-9]*}},
55
40 ; CHECK-NOT: ICE translation error 56 ; CHECK-NOT: ICE translation error
41 ; ERRORS-NOT: ICE translation error 57 ; ERRORS-NOT: ICE translation error
42 ; DUMP-NOT: SZ 58 ; DUMP-NOT: SZ
OLDNEW
« no previous file with comments | « tests_lit/llvm2ice_tests/select-opt.ll ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698