[PATCH] D142615: [WebAssembly] Fix tail call with return_call_indirect instruction

YAMAMOTO Takashi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 26 04:27:50 PST 2023


yamt created this revision.
Herald added subscribers: pmatos, asb, ecnelises, sunfish, hiraditya, jgravelle-google, sbc100, dschuff.
Herald added a project: All.
yamt requested review of this revision.
Herald added subscribers: llvm-commits, aheejin.
Herald added a project: LLVM.

A musttail with function pointers doesn't rewind C stack without this.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142615

Files:
  llvm/lib/Target/WebAssembly/WebAssemblyInstrCall.td


Index: llvm/lib/Target/WebAssembly/WebAssemblyInstrCall.td
===================================================================
--- llvm/lib/Target/WebAssembly/WebAssemblyInstrCall.td
+++ llvm/lib/Target/WebAssembly/WebAssemblyInstrCall.td
@@ -73,7 +73,7 @@
     "return_call    \t$callee", "return_call\t$callee", 0x12>,
   Requires<[HasTailCall]>;
 
-let isReturn = 1 in
+let isReturn = 1, isTerminator = 1, hasCtrlDep = 1, isBarrier = 1 in
 defm RET_CALL_INDIRECT :
   I<(outs), (ins TypeIndex:$type, table32_op:$table, variable_ops),
     (outs), (ins TypeIndex:$type, table32_op:$table), [],


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142615.492388.patch
Type: text/x-patch
Size: 596 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230126/51c56b5b/attachment.bin>


More information about the llvm-commits mailing list