[PATCH] D68889: [WebAssembly] Allow multivalue types in block signature operands

Thomas Lively via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 11 17:28:37 PDT 2019


tlively marked an inline comment as done.
tlively added inline comments.


================
Comment at: llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h:135
+  Exnref = unsigned(wasm::ValType::EXNREF),
+  // Will be lowered to match the function return type in MCInstLower
+  Multivalue = 0xffff,
----------------
dschuff wrote:
> The invariant that only fallthrough-return blocks are allowed to be multivalue should probably be restated here.
> edit: I guess it's not just fallthrough-return blocks, right? Just the last block, even if it has an explicit return?
> We should probably have some more tests for those cases.
Right, it's the last block and the last block within that block recursively. In fact this only happens with explicit returns inside the blocks (or blocks that are otherwise never exited) because blocks that could be fallthrough return blocks instead set their results to a local then have a `local.get` in the return position.

I will expand this comment to reiterate this invariant.

I only added one additional test for this case because the algorithm for determining when to set block types was not changed and is already tested in cfg-stackify.ll.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68889/new/

https://reviews.llvm.org/D68889





More information about the llvm-commits mailing list