Need to reorder the operands to have the callee as the last argument.
Adds a pseudo-instruction, and a pass to lower it into a real
call_indirect.
This is the first of two options for how to fix the problem.
Paths
| Differential D25708
[WebAssembly] Fix for 0xc call_indirect changes ClosedPublic Authored by jgravelle-google on Oct 17 2016, 4:00 PM.
Details Summary Need to reorder the operands to have the callee as the last argument. This is the first of two options for how to fix the problem.
Diff Detail
Event Timelinejgravelle-google updated this object. Comment Actions In particular these two reviews are more "should we go with A or B". I don't think either are ready to land just yet, but feedback as to which direction to commit to would be helpful. Comment Actions Hrm, I see. My preference would be for the approach in this patch, rather than the other. It has the advantage that we handle it in one place, and don't require as much special-casing elsewhere. As one minor nit, the CallIndirectFixup pass should be registered outside the getOptLevel() != CodeGenOpt::None test, since it's needed for correctness. Comment Actions I also vote for this one, so it looks like we all agree. In particular:
Thanks! jgravelle-google edited edge metadata. Comment ActionsMore polished implementation of call_indirect lowering
sunfish edited edge metadata. Comment ActionsLooks good!
This revision is now accepted and ready to land.Oct 20 2016, 1:50 PM Closed by commit rL284840: [WebAssembly] Fix for 0xc call_indirect changes (authored by dschuff). · Explain WhyOct 21 2016, 9:47 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 75445 llvm/trunk/lib/Target/WebAssembly/CMakeLists.txt
llvm/trunk/lib/Target/WebAssembly/WebAssembly.h
llvm/trunk/lib/Target/WebAssembly/WebAssemblyCallIndirectFixup.cpp
llvm/trunk/lib/Target/WebAssembly/WebAssemblyFastISel.cpp
llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrCall.td
llvm/trunk/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
llvm/trunk/test/CodeGen/WebAssembly/call.ll
llvm/trunk/test/CodeGen/WebAssembly/reg-stackify.ll
|