summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/WebAssembly/select.ll
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2015-11-12 17:04:33 +0000
committerDan Gohman <dan433584@gmail.com>2015-11-12 17:04:33 +0000
commitcf4748f18000ac24fb9d07d493be59cf035c8d68 (patch)
treec0290611ac29080e8b3c34f27acc95882da87d4b /llvm/test/CodeGen/WebAssembly/select.ll
parent02bf92d22651dd7feb2828974fdcc5dc0e23ddfb (diff)
downloadbcm5719-llvm-cf4748f18000ac24fb9d07d493be59cf035c8d68.tar.gz
bcm5719-llvm-cf4748f18000ac24fb9d07d493be59cf035c8d68.zip
[WebAssembly] Reapply r252858, with svn add for the new file.
Switch to MC for instruction printing. This encompasses several changes which are all interconnected: - Use the MC framework for printing almost all instructions. - AsmStrings are now live. - This introduces an indirection between LLVM vregs and WebAssembly registers, and a new pass, WebAssemblyRegNumbering, for computing a basic the mapping. This addresses some basic issues with argument registers and unused registers. - The way ARGUMENT instructions are handled no longer generates redundant get_local+set_local for every argument. This also changes the assembly syntax somewhat; most notably, MC's printing does not use sigils on label names, so those are no longer present, and push/pop now have a sigil to keep them unambiguous. The usage of set_local/get_local/$push/$pop will continue to evolve significantly. This patch is just one step of a larger change. llvm-svn: 252910
Diffstat (limited to 'llvm/test/CodeGen/WebAssembly/select.ll')
-rw-r--r--llvm/test/CodeGen/WebAssembly/select.ll40
1 files changed, 12 insertions, 28 deletions
diff --git a/llvm/test/CodeGen/WebAssembly/select.ll b/llvm/test/CodeGen/WebAssembly/select.ll
index 3661b9ba07e..6b9679f9e5e 100644
--- a/llvm/test/CodeGen/WebAssembly/select.ll
+++ b/llvm/test/CodeGen/WebAssembly/select.ll
@@ -7,13 +7,9 @@ target datalayout = "e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32-unknown-unknown"
; CHECK-LABEL: select_i32:
-; CHECK: get_local push, 1
-; CHECK: set_local [[LOCAL_B:[0-9]]]
-; CHECK: get_local push, 0
-; CHECK: set_local [[LOCAL_A:[0-9]]]
-; CHECK: i32.eq push, (get_local 5), (get_local 6)
-; CHECK: set_local 7, pop
-; CHECK: i32.select push, (get_local 7), (get_local [[LOCAL_A]]), (get_local [[LOCAL_B]])
+; CHECK: i32.eq $push, (get_local 2), (get_local 3)
+; CHECK: set_local 4, $pop
+; CHECK: i32.select $push, (get_local 4), (get_local 0), (get_local 1)
define i32 @select_i32(i32 %a, i32 %b, i32 %cond) {
%cc = icmp eq i32 %cond, 0
%result = select i1 %cc, i32 %a, i32 %b
@@ -21,13 +17,9 @@ define i32 @select_i32(i32 %a, i32 %b, i32 %cond) {
}
; CHECK-LABEL: select_i64:
-; CHECK: get_local push, 1
-; CHECK: set_local [[LOCAL_B:[0-9]]]
-; CHECK: get_local push, 0
-; CHECK: set_local [[LOCAL_A:[0-9]]]
-; CHECK: i32.eq push, (get_local 5), (get_local 6)
-; CHECK: set_local 7, pop
-; CHECK: i64.select push, (get_local 7), (get_local [[LOCAL_A]]), (get_local [[LOCAL_B]])
+; CHECK: i32.eq $push, (get_local 2), (get_local 3)
+; CHECK: set_local 4, $pop
+; CHECK: i64.select $push, (get_local 4), (get_local 0), (get_local 1)
define i64 @select_i64(i64 %a, i64 %b, i32 %cond) {
%cc = icmp eq i32 %cond, 0
%result = select i1 %cc, i64 %a, i64 %b
@@ -35,13 +27,9 @@ define i64 @select_i64(i64 %a, i64 %b, i32 %cond) {
}
; CHECK-LABEL: select_f32:
-; CHECK: get_local push, 1
-; CHECK: set_local [[LOCAL_B:[0-9]]]
-; CHECK: get_local push, 0
-; CHECK: set_local [[LOCAL_A:[0-9]]]
-; CHECK: i32.eq push, (get_local 5), (get_local 6)
-; CHECK: set_local 7, pop
-; CHECK: f32.select push, (get_local 7), (get_local [[LOCAL_A]]), (get_local [[LOCAL_B]])
+; CHECK: i32.eq $push, (get_local 2), (get_local 3)
+; CHECK: set_local 4, $pop
+; CHECK: f32.select $push, (get_local 4), (get_local 0), (get_local 1)
define float @select_f32(float %a, float %b, i32 %cond) {
%cc = icmp eq i32 %cond, 0
%result = select i1 %cc, float %a, float %b
@@ -49,13 +37,9 @@ define float @select_f32(float %a, float %b, i32 %cond) {
}
; CHECK-LABEL: select_f64:
-; CHECK: get_local push, 1
-; CHECK: set_local [[LOCAL_B:[0-9]]]
-; CHECK: get_local push, 0
-; CHECK: set_local [[LOCAL_A:[0-9]]]
-; CHECK: i32.eq push, (get_local 5), (get_local 6)
-; CHECK: set_local 7, pop
-; CHECK: f64.select push, (get_local 7), (get_local [[LOCAL_A]]), (get_local [[LOCAL_B]])
+; CHECK: i32.eq $push, (get_local 2), (get_local 3)
+; CHECK: set_local 4, $pop
+; CHECK: f64.select $push, (get_local 4), (get_local 0), (get_local 1)
define double @select_f64(double %a, double %b, i32 %cond) {
%cc = icmp eq i32 %cond, 0
%result = select i1 %cc, double %a, double %b
OpenPOWER on IntegriCloud