[PATCH] D111152: [WebAssembly] Fix call_indirect on funcrefs
Paulo Matos via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 6 01:06:28 PDT 2021
pmatos added inline comments.
================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp:571
+
+ if (IsFuncrefCall) {
+ Register RegZero =
----------------
tlively wrote:
> It would be good to add a comment about why we are adding this zero operand here.
Sure.
================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp:578
+ BB->insert(CallResults.getIterator(), MIBC0);
+ MachineInstrBuilder(MF, CallParams).addReg(RegZero);
+ } else
----------------
tlively wrote:
> Could we use `CallParams.addOperand` here for consistency with the other branch?
I don't think so. You cannot create MachineOperands from scratch. The only reason we can use the addOperand before is because we did not build the operand FnPtr, we extracted it. MachineOperands are built as part of the MachineInstrBuilder, which is what I used.
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