[llvm] [WebAssembly] Disallow tail calls with byval arguments (PR #125142)

Derek Schuff via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 30 16:50:32 PST 2025


================
@@ -296,12 +296,13 @@ define i32 @mismatched_byval(ptr %x) {
 ; CHECK-NEXT:    global.set __stack_pointer, $pop7
 ; CHECK-NEXT:    i32.load $push0=, 0($0)
 ; CHECK-NEXT:    i32.store 12($1), $pop0
+; CHECK-NEXT:    i32.const $push5=, 12
+; CHECK-NEXT:    i32.add $push6=, $1, $pop5
+; CHECK-NEXT:    call $0=, quux, $pop6
----------------
dschuff wrote:

It seems that if this were actually a "matched" byval (i.e. the caller had a byval param that was passed directly to the callee's byval param) then it could work, since the caller wouldn't need to allocate space on its own stack for the byval.
I'm not sure it would be worth implementing that though.

https://github.com/llvm/llvm-project/pull/125142


More information about the llvm-commits mailing list