summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/WebAssembly/phi.ll
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2015-09-08 12:39:25 +0000
committerDan Gohman <dan433584@gmail.com>2015-09-08 12:39:25 +0000
commit25d2a0dda42a86a82579a2ca4abc037ed2402eb8 (patch)
tree76a65f86ab4d2f37fbcf00963649197980d2c893 /llvm/test/CodeGen/WebAssembly/phi.ll
parent16bb65431cf35924594b37de5f6972052b8ade71 (diff)
downloadbcm5719-llvm-25d2a0dda42a86a82579a2ca4abc037ed2402eb8.tar.gz
bcm5719-llvm-25d2a0dda42a86a82579a2ca4abc037ed2402eb8.zip
[WebAssembly] Enable SSA lowering and other pre-regalloc passes
llvm-svn: 247008
Diffstat (limited to 'llvm/test/CodeGen/WebAssembly/phi.ll')
-rw-r--r--llvm/test/CodeGen/WebAssembly/phi.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/WebAssembly/phi.ll b/llvm/test/CodeGen/WebAssembly/phi.ll
new file mode 100644
index 00000000000..c217cbf3572
--- /dev/null
+++ b/llvm/test/CodeGen/WebAssembly/phi.ll
@@ -0,0 +1,22 @@
+; RUN: llc < %s -asm-verbose=false | FileCheck %s
+
+; Test that phis are lowered.
+
+target datalayout = "e-p:32:32-i64:64-v128:8:128-n32:64-S128"
+target triple = "wasm32-unknown-unknown"
+
+; CHECK-LABEL: test0
+; CHECK: (setlocal [[REG:@.*]] (argument 0))
+; CHECK: (setlocal [[REG]] (sdiv [[REG]] {{.*}}))
+; CHECK: (return [[REG]])
+define i32 @test0(i32 %p) {
+entry:
+ %t = icmp slt i32 %p, 0
+ br i1 %t, label %true, label %done
+true:
+ %a = sdiv i32 %p, 3
+ br label %done
+done:
+ %s = phi i32 [ %a, %true ], [ %p, %entry ]
+ ret i32 %s
+}
OpenPOWER on IntegriCloud