[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
diff --git a/llvm/test/CodeGen/WebAssembly/select.ll b/llvm/test/CodeGen/WebAssembly/select.ll
index 3661b9b..6b9679f 100644
--- a/llvm/test/CodeGen/WebAssembly/select.ll
+++ b/llvm/test/CodeGen/WebAssembly/select.ll
@@ -7,13 +7,9 @@
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 @@
}
; 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 @@
}
; 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 @@
}
; 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