[PATCH] D111152: [WebAssembly] Fix call_indirect on funcrefs

Thomas Lively via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 5 11:36:40 PDT 2021


tlively accepted this revision.
tlively added a comment.
This revision is now accepted and ready to land.

Ah, yes, this fix makes sense. LGTM modulo comments.



================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp:571
+
+    if (IsFuncrefCall) {
+      Register RegZero =
----------------
It would be good to add a comment about why we are adding this zero operand here.


================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp:578
+      BB->insert(CallResults.getIterator(), MIBC0);
+      MachineInstrBuilder(MF, CallParams).addReg(RegZero);
+    } else
----------------
Could we use `CallParams.addOperand` here for consistency with the other branch?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111152



More information about the llvm-commits mailing list