diff options
| author | Thomas Lively <tlively@google.com> | 2019-06-26 16:17:15 +0000 |
|---|---|---|
| committer | Thomas Lively <tlively@google.com> | 2019-06-26 16:17:15 +0000 |
| commit | a1d97a960e622ee21550d92809512cb0870be499 (patch) | |
| tree | 678b01b3a42a707b3be32cf74c635072c14f74da /llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp | |
| parent | c95046501dc2cb535a82c38a5c004a6eddd33e00 (diff) | |
| download | bcm5719-llvm-a1d97a960e622ee21550d92809512cb0870be499.tar.gz bcm5719-llvm-a1d97a960e622ee21550d92809512cb0870be499.zip | |
[WebAssembly] Implement tail calls and unify tablegen call classes
Summary:
Implements direct and indirect tail calls enabled by the 'tail-call'
feature in both DAG ISel and FastISel. Updates existing call tests and
adds new tests including a binary encoding test.
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62877
llvm-svn: 364445
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp')
| -rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp index 39c682dc7ca..4fff49f54d7 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp @@ -741,6 +741,7 @@ bool WebAssemblyFastISel::fastLowerArguments() { bool WebAssemblyFastISel::selectCall(const Instruction *I) { const auto *Call = cast<CallInst>(I); + // TODO: Support tail calls in FastISel if (Call->isMustTailCall() || Call->isInlineAsm() || Call->getFunctionType()->isVarArg()) return false; @@ -769,19 +770,19 @@ bool WebAssemblyFastISel::selectCall(const Instruction *I) { case MVT::i8: case MVT::i16: case MVT::i32: - Opc = IsDirect ? WebAssembly::CALL_I32 : WebAssembly::PCALL_INDIRECT_I32; + Opc = IsDirect ? WebAssembly::CALL_i32 : WebAssembly::PCALL_INDIRECT_i32; ResultReg = createResultReg(&WebAssembly::I32RegClass); break; case MVT::i64: - Opc = IsDirect ? WebAssembly::CALL_I64 : WebAssembly::PCALL_INDIRECT_I64; + Opc = IsDirect ? WebAssembly::CALL_i64 : WebAssembly::PCALL_INDIRECT_i64; ResultReg = createResultReg(&WebAssembly::I64RegClass); break; case MVT::f32: - Opc = IsDirect ? WebAssembly::CALL_F32 : WebAssembly::PCALL_INDIRECT_F32; + Opc = IsDirect ? WebAssembly::CALL_f32 : WebAssembly::PCALL_INDIRECT_f32; ResultReg = createResultReg(&WebAssembly::F32RegClass); break; case MVT::f64: - Opc = IsDirect ? WebAssembly::CALL_F64 : WebAssembly::PCALL_INDIRECT_F64; + Opc = IsDirect ? WebAssembly::CALL_f64 : WebAssembly::PCALL_INDIRECT_f64; ResultReg = createResultReg(&WebAssembly::F64RegClass); break; case MVT::v16i8: @@ -815,8 +816,8 @@ bool WebAssemblyFastISel::selectCall(const Instruction *I) { ResultReg = createResultReg(&WebAssembly::V128RegClass); break; case MVT::ExceptRef: - Opc = IsDirect ? WebAssembly::CALL_EXCEPT_REF - : WebAssembly::PCALL_INDIRECT_EXCEPT_REF; + Opc = IsDirect ? WebAssembly::CALL_ExceptRef + : WebAssembly::PCALL_INDIRECT_ExceptRef; ResultReg = createResultReg(&WebAssembly::EXCEPT_REFRegClass); break; default: |

