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

Unified Diff: test/NaCl/Bitcode/pnacl-bcdis/phi.ll

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod 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
« no previous file with comments | « test/NaCl/Bitcode/pnacl-bcdis/no-abbreviations.ll ('k') | test/NaCl/Bitcode/pnacl-bcdis/ret.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/NaCl/Bitcode/pnacl-bcdis/phi.ll
diff --git a/test/NaCl/Bitcode/pnacl-bcdis/phi.ll b/test/NaCl/Bitcode/pnacl-bcdis/phi.ll
new file mode 100644
index 0000000000000000000000000000000000000000..2c8758cdad69601e7ed7bfdb588daa3ac551fe08
--- /dev/null
+++ b/test/NaCl/Bitcode/pnacl-bcdis/phi.ll
@@ -0,0 +1,77 @@
+; Simple test for phi nodes.
+
+; RUN: llvm-as < %s | pnacl-freeze | pnacl-bccompress --remove-abbreviations \
+; RUN: | pnacl-bcdis | FileCheck %s
+
+
+
+; Test phi node introduced by branch merge.
+define void @PhiBranchMerge() {
+
+
+b0:
+ br i1 0, label %b1, label %b2
+
+; CHECK: | | %b0:
+; CHECK-NEXT: {{.*}}| 3: <11, 1, 2, 1> | br i1 %c1, label %b1, label %b2;
+
+b1:
+ %v0 = add i32 1, 1
+ %v1 = sub i32 1, 1
+ br label %b3
+
+; CHECK-NEXT: | | %b1:
+; CHECK-NEXT: {{.*}}| 3: <2, 2, 2, 0> | %v0 = add i32 %c0, %c0;
+; CHECK-NEXT: {{.*}}| 3: <2, 3, 3, 1> | %v1 = sub i32 %c0, %c0;
+; CHECK-NEXT: {{.*}}| 3: <11, 3> | br label %b3;
+
+b2:
+ %v2 = mul i32 1, 1
+ %v3 = udiv i32 1, 1
+ br label %b3
+
+; CHECK-NEXT: | | %b2:
+; CHECK-NEXT: {{.*}}| 3: <2, 4, 4, 2> | %v2 = mul i32 %c0, %c0;
+; CHECK-NEXT: {{.*}}| 3: <2, 5, 5, 3> | %v3 = udiv i32 %c0, %c0;
+; CHECK-NEXT: {{.*}}| 3: <11, 3> | br label %b3;
+
+b3:
+ %v4 = phi i32 [ %v0, %b1 ], [ %v2, %b2 ]
+ %v5 = phi i32 [ %v1, %b1 ], [ %v3, %b2 ]
+ ret void
+
+; CHECK-NEXT: | | %b3:
+; CHECK-NEXT: {{.*}}| 3: <16, 0, 8, 1, 4, 2> | %v4 = phi i32 [%v0, %b1],
+; CHECK-NEXT: {{.*}}| | [%v2, %b2];
+; CHECK-NEXT: {{.*}}| 3: <16, 0, 8, 1, 4, 2> | %v5 = phi i32 [%v1, %b1],
+; CHECK-NEXT: | | [%v3, %b2];
+; CHECK-NEXT: {{.*}}| 3: <10> | ret void;
+
+}
+
+
+
+; Test phi node introduced by loop.
+define void @PhiLoopCarried(i32 %p0) {
+
+b0:
+ %v0 = add i32 %p0, 1
+ br label %b1
+
+; CHECK: | | %b0:
+; CHECK-NEXT: {{.*}}| 3: <2, 2, 1, 0> | %v0 = add i32 %p0, %c0;
+; CHECK-NEXT: {{.*}}| 3: <11, 1> | br label %b1;
+
+b1:
+ %v1 = phi i32 [%v0, %b0], [%v2, %b1]
+ %v2 = add i32 %v1, 1
+ br label %b1
+
+; CHECK-NEXT: | | %b1:
+; CHECK-NEXT: {{.*}}| 3: <43, 6, 0> | declare i32 %v2;
+; CHECK-NEXT: {{.*}}| 3: <16, 0, 2, 0, 3, 1> | %v1 = phi i32 [%v0, %b0],
+; CHECK-NEXT: | | [%v2, %b1];
+; CHECK-NEXT: {{.*}}| 3: <2, 1, 3, 0> | %v2 = add i32 %v1, %c0;
+; CHECK-NEXT: {{.*}}| 3: <11, 1> | br label %b1;
+
+}
« no previous file with comments | « test/NaCl/Bitcode/pnacl-bcdis/no-abbreviations.ll ('k') | test/NaCl/Bitcode/pnacl-bcdis/ret.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698