[WebAssembly] Fix for 0xc call_indirect changes
authorDerek Schuff <dschuff@google.com>
Fri, 21 Oct 2016 16:38:07 +0000 (16:38 +0000)
committerDerek Schuff <dschuff@google.com>
Fri, 21 Oct 2016 16:38:07 +0000 (16:38 +0000)
commit6f69783f1fa51cd748d0439b17da3e3ee23cc3f8
treed9ad8bff62eca303a04816379f4e4e34b5464a33
parent9daf8110c82f5245e5e263e8a03ce745e6da5f40
[WebAssembly] Fix for 0xc call_indirect changes

Summary:
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.

Reviewers: dschuff, sunfish

Subscribers: jfb, beanz, mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D25708

llvm-svn: 284840
llvm/lib/Target/WebAssembly/CMakeLists.txt
llvm/lib/Target/WebAssembly/WebAssembly.h
llvm/lib/Target/WebAssembly/WebAssemblyCallIndirectFixup.cpp [new file with mode: 0644]
llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp
llvm/lib/Target/WebAssembly/WebAssemblyInstrCall.td
llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
llvm/test/CodeGen/WebAssembly/call.ll
llvm/test/CodeGen/WebAssembly/reg-stackify.ll