[WebAssembly] Do not emit tail calls with return type mismatch
authorThomas Lively <tlively@google.com>
Tue, 30 Jul 2019 18:08:39 +0000 (18:08 +0000)
committerThomas Lively <tlively@google.com>
Tue, 30 Jul 2019 18:08:39 +0000 (18:08 +0000)
commite0a9dce543adaf72506f72d7a4f595e41aed3865
treeb596f042cca704cb5b8597e2a96686fe60254ea9
parent130ec06843fad63e45a08f5825b0bbba9e5f557e
[WebAssembly] Do not emit tail calls with return type mismatch

Summary:
return_call and return_call_indirect are only valid if the return
types of the callee and caller match. We were previously not enforcing
that, which was producing invalid modules.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65246

llvm-svn: 367339
llvm/docs/CodeGenerator.rst
llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
llvm/test/CodeGen/WebAssembly/tailcall.ll