[WebAssembly] Implement eliminateCallFramePseudo
authorDerek Schuff <dschuff@google.com>
Wed, 16 Dec 2015 23:21:30 +0000 (23:21 +0000)
committerDerek Schuff <dschuff@google.com>
Wed, 16 Dec 2015 23:21:30 +0000 (23:21 +0000)
commit6b90fe4207bcd41cd7527fec66235c6c7c8cbc07
tree9f786811a9880e422190235e4bd19abde3302e4d
parentd912be98f8ebfa99ab9fa2d985d3f4e9cddf2df6
[WebAssembly] Implement eliminateCallFramePseudo

Summary:
Implement eliminateCallFramePsuedo to handle ADJCALLSTACKUP/DOWN
pseudo-instructions. Add a test calling a vararg function which causes non-0
adjustments. This revealed an issue with RegisterCoalescer wherein it
eliminates a COPY from SP32 to a vreg but failes to update the live ranges
of EXPR_STACK, causing a machineinstr verifier failure (so this test
is commented out).

Also add a dynamic alloca test, which causes a callseq_end dag node with
a 0 (instead of undef) second argument to be generated. We currently fail to
select that, so adjust the ADJCALLSTACKUP tablegen code to handle it.

Differential Revision: http://reviews.llvm.org/D15587

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255844 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp
lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
lib/Target/WebAssembly/WebAssemblyInstrCall.td
lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp
lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
test/CodeGen/WebAssembly/userstack.ll
test/CodeGen/WebAssembly/varargs.ll