[WebAssembly] Reintroduce ARGUMENT moving logic
authorDan Gohman <dan433584@gmail.com>
Wed, 9 Dec 2015 16:23:59 +0000 (16:23 +0000)
committerDan Gohman <dan433584@gmail.com>
Wed, 9 Dec 2015 16:23:59 +0000 (16:23 +0000)
commit4c8fe28374d0fee214c9af21329f5b0e93a14615
treead91d572e7d5c9cc3694b581b83399d93383409d
parenteb103602da8248367c11249982010b15885f8ae4
[WebAssembly] Reintroduce ARGUMENT moving logic

Reinteroduce the code for moving ARGUMENTS back to the top of the basic block.
While the ARGUMENTS physical register prevents sinking and scheduling from
moving them, it does not appear to be sufficient to prevent SelectionDAG from
moving them down in the initial schedule. This patch introduces a patch that
moves them back to the top immediately after SelectionDAG runs.

This is still hopefully a temporary solution. http://reviews.llvm.org/D14750 is
one alternative, though the review has not been favorable, and proposed
alternatives are longer-term and have other downsides.

This fixes the main outstanding -verify-machineinstrs failures, so it adds
-verify-machineinstrs to several tests.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255125 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/WebAssembly/CMakeLists.txt
lib/Target/WebAssembly/WebAssembly.h
lib/Target/WebAssembly/WebAssemblyArgumentMove.cpp [new file with mode: 0644]
lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
test/CodeGen/WebAssembly/dead-vreg.ll
test/CodeGen/WebAssembly/phi.ll
test/CodeGen/WebAssembly/reg-stackify.ll
test/CodeGen/WebAssembly/switch.ll
test/CodeGen/WebAssembly/unreachable.ll
test/CodeGen/WebAssembly/varargs.ll