[PATCH] D62877: [WebAssembly] Implement tail calls and unify tablegen call classes

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 8 15:26:23 PDT 2019


aheejin added inline comments.


================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp:795
   SDVTList InTyList = DAG.getVTList(InTys);
-  SDValue Res =
-      DAG.getNode(Ins.empty() ? WebAssemblyISD::CALL0 : WebAssemblyISD::CALL1,
-                  DL, InTyList, Ops);
-  if (Ins.empty()) {
+  unsigned Opcode = CLI.IsTailCall ? WebAssemblyISD::RET_CALL
+                                   : (Ins.empty() ? WebAssemblyISD::CALL0
----------------
Now we have reverted to the previous logic, we don't need `RET_CALL` here


================
Comment at: llvm/test/CodeGen/WebAssembly/tailcall.ll:120
+define i32 @mismatched_prototypes() {
+  %v = tail call i32 @baz(i32 0, i32 42, i32 6)
+  ret i32 %v
----------------
Not sure what this tests..? The function name is `mismatched_prototypes` but the prototypes here match. And the comment says `musttail requires ...` but this is not a `musttail` but a `tail`. The same for other methods below.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62877/new/

https://reviews.llvm.org/D62877





More information about the llvm-commits mailing list