diff options
author | Thomas Lively <tlively@google.com> | 2019-10-09 21:42:08 +0000 |
---|---|---|
committer | Thomas Lively <tlively@google.com> | 2019-10-09 21:42:08 +0000 |
commit | 00f9e5aa76f4932098da375545ee144d884eced3 (patch) | |
tree | 93f1c4c66045344f64c393e2eff419601c61aa3b /llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp | |
parent | ffb26d9c7830f0f957caca155c2c56e173043906 (diff) | |
download | llvm-00f9e5aa76f4932098da375545ee144d884eced3.zip llvm-00f9e5aa76f4932098da375545ee144d884eced3.tar.gz llvm-00f9e5aa76f4932098da375545ee144d884eced3.tar.bz2 |
[WebAssembly] Make returns variadic
Summary:
This is necessary and sufficient to get simple cases of multiple
return working with multivalue enabled. More complex cases will
require block and loop signatures to be generalized to potentially be
type indices as well.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68684
llvm-svn: 374235
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp index 1032709..fbccc58 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp @@ -1227,11 +1227,11 @@ getDepth(const SmallVectorImpl<const MachineBasicBlock *> &Stack, /// checks for such cases and fixes up the signatures. void WebAssemblyCFGStackify::fixEndsAtEndOfFunction(MachineFunction &MF) { const auto &MFI = *MF.getInfo<WebAssemblyFunctionInfo>(); - assert(MFI.getResults().size() <= 1); if (MFI.getResults().empty()) return; + // TODO: Generalize from value types to function types for multivalue WebAssembly::ExprType RetType; switch (MFI.getResults().front().SimpleTy) { case MVT::i32: @@ -1266,10 +1266,14 @@ void WebAssemblyCFGStackify::fixEndsAtEndOfFunction(MachineFunction &MF) { if (MI.isPosition() || MI.isDebugInstr()) continue; if (MI.getOpcode() == WebAssembly::END_BLOCK) { + if (MFI.getResults().size() > 1) + report_fatal_error("Multivalue block signatures not implemented yet"); EndToBegin[&MI]->getOperand(0).setImm(int32_t(RetType)); continue; } if (MI.getOpcode() == WebAssembly::END_LOOP) { + if (MFI.getResults().size() > 1) + report_fatal_error("Multivalue loop signatures not implemented yet"); EndToBegin[&MI]->getOperand(0).setImm(int32_t(RetType)); continue; } |