[WebAssembly] Replace all calls with generalized multivalue calls
Summary:
Extends the multivalue call infrastructure to tail calls, removes all
legacy calls specialized for particular result types, and removes the
CallIndirectFixup pass, since all indirect call arguments are now
fixed up directly in the post-insertion hook.
In order to keep supporting pretty-printed defs and uses in test
expectations, MCInstLower now inserts an immediate containing the
number of defs for each call and call_indirect. The InstPrinter is
updated to query this immediate if it is present and determine which
MCOperands are defs and uses accordingly.
Depends on D72902.
Reviewers: aheejin
Subscribers: dschuff, mgorny, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74192
diff --git a/llvm/test/CodeGen/WebAssembly/function-bitcasts.ll b/llvm/test/CodeGen/WebAssembly/function-bitcasts.ll
index 91bb1b6..528d7d8 100644
--- a/llvm/test/CodeGen/WebAssembly/function-bitcasts.ll
+++ b/llvm/test/CodeGen/WebAssembly/function-bitcasts.ll
@@ -24,7 +24,7 @@
; CHECK: call .Lhas_i32_arg_bitcast.2{{$}}
; CHECK-NEXT: call .Lhas_i32_arg_bitcast.2{{$}}
; CHECK-NEXT: call .Lhas_i32_ret_bitcast{{$}}
-; CHECK-NEXT: i32.call $drop=, has_i32_ret
+; CHECK-NEXT: call $drop=, has_i32_ret
; CHECK-NEXT: i32.const $push[[L0:[0-9]+]]=, 0
; CHECK-NEXT: call .Lfoo0_bitcast, $pop[[L0]]{{$}}
; CHECK-NEXT: i32.const $push[[L1:[0-9]+]]=, 0
@@ -32,7 +32,7 @@
; CHECK-NEXT: i32.const $push[[L2:[0-9]+]]=, 0
; CHECK-NEXT: call .Lfoo0_bitcast, $pop[[L2]]{{$}}
; CHECK-NEXT: call foo0
-; CHECK-NEXT: i32.call $drop=, .Lfoo1_bitcast{{$}}
+; CHECK-NEXT: call $drop=, .Lfoo1_bitcast{{$}}
; CHECK-NEXT: call foo2{{$}}
; CHECK-NEXT: call foo1{{$}}
; CHECK-NEXT: call foo3{{$}}
@@ -126,7 +126,7 @@
; CHECK-NEXT: .functype test_load () -> (i32){{$}}
; CHECK-NEXT: i32.const $push[[L0:[0-9]+]]=, 0{{$}}
; CHECK-NEXT: i32.load $push[[L1:[0-9]+]]=, global_func($pop[[L0]]){{$}}
-; CHECK-NEXT: i32.call_indirect $push{{[0-9]+}}=, $pop[[L1]]{{$}}
+; CHECK-NEXT: call_indirect $push{{[0-9]+}}=, $pop[[L1]]{{$}}
define i32 @test_load() {
%1 = load i32 ()*, i32 ()** bitcast (void ()** @global_func to i32 ()**)
%2 = call i32 %1()