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

Unified Diff: tests_lit/llvm2ice_tests/phi.ll

Issue 969703002: Subzero: Fix a register allocation issue for "advanced phi lowering". (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Improve comments Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« src/IceTargetLoweringX8632.cpp ('K') | « src/IceTargetLoweringX8632.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests_lit/llvm2ice_tests/phi.ll
diff --git a/tests_lit/llvm2ice_tests/phi.ll b/tests_lit/llvm2ice_tests/phi.ll
index abdc1b3beaf4068521811519515b4b7da516a354..4e75850c2115a664eb5138f608c5f991b9994cc5 100644
--- a/tests_lit/llvm2ice_tests/phi.ll
+++ b/tests_lit/llvm2ice_tests/phi.ll
@@ -4,6 +4,8 @@
; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 --phi-edge-split=0 \
; RUN: | FileCheck %s
+; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 --phi-edge-split=1 \
+; RUN: | FileCheck --check-prefix=SPLIT %s
define internal i32 @testPhi1(i32 %arg) {
entry:
@@ -99,3 +101,59 @@ exit:
; CHECK: jne
; CHECK: mov DWORD PTR [[ADDR]]
; CHECK: pop [[EBX]]
+
+; Test of "advanced phi lowering" with undef phi arg (integer vector).
+define internal <4 x i32> @test_split_undef_int_vec(<4 x i32> %arg, i32 %cond) {
+entry:
+ %cmp = icmp eq i32 %cond, 0
+ br i1 %cmp, label %eq, label %exit
+eq:
+ br label %exit
+exit:
+ %merge = phi <4 x i32> [ %arg, %entry ], [ undef, %eq ]
+ ret <4 x i32> %merge
+}
+; SPLIT-LABEL: test_split_undef_int_vec
+; SPLIT: pxor
+
+; Test of "advanced phi lowering" with undef phi arg (float vector).
+define internal <4 x float> @test_split_undef_float_vec(<4 x float> %arg, i32 %cond) {
+entry:
+ %cmp = icmp eq i32 %cond, 0
+ br i1 %cmp, label %eq, label %exit
+eq:
+ br label %exit
+exit:
+ %merge = phi <4 x float> [ %arg, %entry ], [ undef, %eq ]
+ ret <4 x float> %merge
+}
+; SPLIT-LABEL: test_split_undef_float_vec
+; SPLIT: pxor
+
+; Test of "advanced phi lowering" with undef phi arg (integer scalar).
+define internal i32 @test_split_undef_int_scalar(i32 %arg, i32 %cond) {
+entry:
+ %cmp = icmp eq i32 %cond, 0
+ br i1 %cmp, label %eq, label %exit
+eq:
+ br label %exit
+exit:
+ %merge = phi i32 [ %arg, %entry ], [ undef, %eq ]
+ ret i32 %merge
+}
+; SPLIT-LABEL: test_split_undef_int_scalar
+; SPLIT: mov {{.*}},0x0
+
+; Test of "advanced phi lowering" with undef phi arg (float scalar).
+define internal float @test_split_undef_float_scalar(float %arg, i32 %cond) {
+entry:
+ %cmp = icmp eq i32 %cond, 0
+ br i1 %cmp, label %eq, label %exit
+eq:
+ br label %exit
+exit:
+ %merge = phi float [ %arg, %entry ], [ undef, %eq ]
+ ret float %merge
+}
+; SPLIT-LABEL: test_split_undef_float_scalar
+; SPLIT: movss {{.*}},DWORD PTR
« src/IceTargetLoweringX8632.cpp ('K') | « src/IceTargetLoweringX8632.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698