[WebAssembly] Allow multivalue types in block signature operands
authorThomas Lively <tlively@google.com>
Tue, 15 Oct 2019 18:28:22 +0000 (18:28 +0000)
committerThomas Lively <tlively@google.com>
Tue, 15 Oct 2019 18:28:22 +0000 (18:28 +0000)
commit2cb27072cefb11d5018735a3b70a903dc1d319ac
treeb007b3e4e319c5caf584201dceb06b0852aee65b
parent0650355c09ab8e6605ae37b818270a7a7c8ce2c7
[WebAssembly] Allow multivalue types in block signature operands

Summary:
Renames `ExprType` to the more apt `BlockType` and adds a variant for
multivalue blocks. Currently non-void blocks are only generated at the
end of functions where the block return type needs to agree with the
function return type, and that remains true for multivalue
blocks. That invariant means that the actual signature does not need
to be stored in the block signature `MachineOperand` because it can be
inferred by `WebAssemblyMCInstLower` from the return type of the
parent function. `WebAssemblyMCInstLower` continues to lower block
signature operands to immediates when possible but lowers multivalue
signatures to function type symbols. The AsmParser and Disassembler
are updated to handle multivalue block types as well.

Reviewers: aheejin, dschuff, aardappel

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68889

llvm-svn: 374933
15 files changed:
llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
llvm/lib/Target/WebAssembly/Disassembler/LLVMBuild.txt
llvm/lib/Target/WebAssembly/Disassembler/WebAssemblyDisassembler.cpp
llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.cpp
llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp
llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h
llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.h
llvm/test/CodeGen/WebAssembly/multivalue.ll
llvm/test/MC/Disassembler/WebAssembly/wasm-error.txt
llvm/test/MC/WebAssembly/basic-assembly.s
llvm/tools/llvm-mc/Disassembler.cpp
llvm/tools/llvm-mc/Disassembler.h
llvm/tools/llvm-mc/llvm-mc.cpp