[WebAssembly] Reapply r252858, with svn add for the new file.
authorDan Gohman <dan433584@gmail.com>
Thu, 12 Nov 2015 17:04:33 +0000 (17:04 +0000)
committerDan Gohman <dan433584@gmail.com>
Thu, 12 Nov 2015 17:04:33 +0000 (17:04 +0000)
commitd39c38d2bc46ff3a8bde75285432f56a83ee02a7
tree4539449e44d6d86ea555ea5b4a6b304c8da7b6f0
parent8e8b0ba38b56b006ba44cc161fcc7d0fed2dbbd3
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252910 91177308-0d34-0410-b5e6-96231b3b80d8
39 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/WebAssemblyRegNumbering.cpp [new file with mode: 0644]
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