[WebAssembly] Switch to MC for instruction printing.
authorDan Gohman <dan433584@gmail.com>
Thu, 12 Nov 2015 06:10:03 +0000 (06:10 +0000)
committerDan Gohman <dan433584@gmail.com>
Thu, 12 Nov 2015 06:10:03 +0000 (06:10 +0000)
commit41e2c9884254233141ecf07344729734ba060832
tree507530798fba80b6bd41acc72e9b2d2100c5e2fd
parentc1a030fd64211aab1555b6d0cc2818c86ab9390d
[WebAssembly] 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
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252858 91177308-0d34-0410-b5e6-96231b3b80d8
38 files changed:
lib/Target/WebAssembly/CMakeLists.txt
lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp
lib/Target/WebAssembly/WebAssembly.h
lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
lib/Target/WebAssembly/WebAssemblyInstrCall.td
lib/Target/WebAssembly/WebAssemblyInstrControl.td
lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h
lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
test/CodeGen/WebAssembly/call.ll
test/CodeGen/WebAssembly/cfg-stackify.ll
test/CodeGen/WebAssembly/comparisons_f32.ll
test/CodeGen/WebAssembly/comparisons_f64.ll
test/CodeGen/WebAssembly/comparisons_i32.ll
test/CodeGen/WebAssembly/comparisons_i64.ll
test/CodeGen/WebAssembly/conv.ll
test/CodeGen/WebAssembly/dead-vreg.ll
test/CodeGen/WebAssembly/f32.ll
test/CodeGen/WebAssembly/f64.ll
test/CodeGen/WebAssembly/fast-isel.ll
test/CodeGen/WebAssembly/func.ll
test/CodeGen/WebAssembly/i32.ll
test/CodeGen/WebAssembly/i64.ll
test/CodeGen/WebAssembly/immediates.ll
test/CodeGen/WebAssembly/import.ll
test/CodeGen/WebAssembly/load-ext.ll
test/CodeGen/WebAssembly/load-store-i1.ll
test/CodeGen/WebAssembly/load.ll
test/CodeGen/WebAssembly/memory-addr32.ll
test/CodeGen/WebAssembly/memory-addr64.ll
test/CodeGen/WebAssembly/phi.ll
test/CodeGen/WebAssembly/return-int32.ll
test/CodeGen/WebAssembly/select.ll
test/CodeGen/WebAssembly/store-trunc.ll
test/CodeGen/WebAssembly/store.ll
test/CodeGen/WebAssembly/switch.ll
test/CodeGen/WebAssembly/unreachable.ll
test/CodeGen/WebAssembly/unused-argument.ll