diff options
| author | Thomas Lively <tlively@google.com> | 2019-10-15 18:28:22 +0000 |
|---|---|---|
| committer | Thomas Lively <tlively@google.com> | 2019-10-15 18:28:22 +0000 |
| commit | 2cb27072cefb11d5018735a3b70a903dc1d319ac (patch) | |
| tree | b007b3e4e319c5caf584201dceb06b0852aee65b /llvm/test/MC/WebAssembly | |
| parent | 0650355c09ab8e6605ae37b818270a7a7c8ce2c7 (diff) | |
| download | bcm5719-llvm-2cb27072cefb11d5018735a3b70a903dc1d319ac.tar.gz bcm5719-llvm-2cb27072cefb11d5018735a3b70a903dc1d319ac.zip | |
[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
Diffstat (limited to 'llvm/test/MC/WebAssembly')
| -rw-r--r-- | llvm/test/MC/WebAssembly/basic-assembly.s | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/MC/WebAssembly/basic-assembly.s b/llvm/test/MC/WebAssembly/basic-assembly.s index 6de4cff8a05..17b501b2568 100644 --- a/llvm/test/MC/WebAssembly/basic-assembly.s +++ b/llvm/test/MC/WebAssembly/basic-assembly.s @@ -55,6 +55,12 @@ test0: block i64 block f32 block f64 + block () -> (i32, i32) + i32.const 1 + i32.const 2 + end_block + drop + drop br_table {0, 1, 2} # 2 entries, default end_block # first entry jumps here. i32.const 1 @@ -162,6 +168,12 @@ test0: # CHECK-NEXT: block i64 # CHECK-NEXT: block f32 # CHECK-NEXT: block f64 +# CHECK-NEXT: block () -> (i32, i32) +# CHECK-NEXT: i32.const 1 +# CHECK-NEXT: i32.const 2 +# CHECK-NEXT: end_block +# CHECK-NEXT: drop +# CHECK-NEXT: drop # CHECK-NEXT: br_table {0, 1, 2} # 1: down to label4 # CHECK-NEXT: # 2: down to label3 # CHECK-NEXT: end_block # label5: |

