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

Unified Diff: tests_lit/llvm2ice_tests/reorder-basic-blocks.ll

Issue 1255303004: Add -reorder-basic-blocks option and fix nop insertion (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: rebase to master branch 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests_lit/llvm2ice_tests/nop-insertion.ll ('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/reorder-basic-blocks.ll
diff --git a/tests_lit/llvm2ice_tests/reorder-basic-blocks.ll b/tests_lit/llvm2ice_tests/reorder-basic-blocks.ll
new file mode 100644
index 0000000000000000000000000000000000000000..9df88eb4fc237d80c9b519ac6c9cd7de6aeefcf7
--- /dev/null
+++ b/tests_lit/llvm2ice_tests/reorder-basic-blocks.ll
@@ -0,0 +1,41 @@
+; Trivial smoke test of basic block reordering. Different random seeds should
+; generate different basic block layout.
+; REQUIRES allow_dump
+
+; RUN: %p2i -i %s --filetype=asm --args -O2 -sz-seed=1 \
+; RUN: -reorder-basic-blocks -threads=0 \
+; RUN: | FileCheck %s --check-prefix=SEED1
+; RUN: %p2i -i %s --filetype=asm --args -O2 -sz-seed=2 \
+; RUN: -reorder-basic-blocks -threads=0 \
+; RUN: | FileCheck %s --check-prefix=SEED2
+
+define void @basic_block_reordering(i32 %foo, i32 %bar) {
+entry:
+ %r1 = icmp eq i32 %foo, %bar
+ br i1 %r1, label %BB1, label %BB2
+BB1:
+ %r2 = icmp sgt i32 %foo, %bar
+ br i1 %r2, label %BB3, label %BB4
+BB2:
+ %r3 = icmp slt i32 %foo, %bar
+ br i1 %r3, label %BB3, label %BB4
+BB3:
+ ret void
+BB4:
+ ret void
+
+
+; SEED1-LABEL: basic_block_reordering:
+; SEED1: .Lbasic_block_reordering$entry:
+; SEED1: .Lbasic_block_reordering$BB1:
+; SEED1: .Lbasic_block_reordering$BB2:
+; SEED1: .Lbasic_block_reordering$BB3:
+; SEED1: .Lbasic_block_reordering$BB4:
+
+; SEED2-LABEL: basic_block_reordering:
+; SEED2: .Lbasic_block_reordering$entry:
+; SEED2: .Lbasic_block_reordering$BB2:
+; SEED2: .Lbasic_block_reordering$BB1:
+; SEED2: .Lbasic_block_reordering$BB4:
+; SEED2: .Lbasic_block_reordering$BB3
+}
« no previous file with comments | « tests_lit/llvm2ice_tests/nop-insertion.ll ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698