[WebAssembly] Insert COPY_LOCAL between CopyToReg and FrameIndex DAG nodes
authorDerek Schuff <dschuff@google.com>
Tue, 16 Feb 2016 18:18:36 +0000 (18:18 +0000)
committerDerek Schuff <dschuff@google.com>
Tue, 16 Feb 2016 18:18:36 +0000 (18:18 +0000)
commitaadc89c25d664d8c52b7a96b1db1d581cd435358
tree1bcfd5585267ea813c4d88d9ef15b04dbb5d5659
parentcc4c8718ed09b783a03f93500b96aea41f8273b4
[WebAssembly] Insert COPY_LOCAL between CopyToReg and FrameIndex DAG nodes

CopyToReg nodes don't support FrameIndex operands. Other targets select
the FI to some LEA-like instruction, but since we don't have that, we
need to insert some kind of instruction that can take an FI operand and
produces a value usable by CopyToReg (i.e. in a vreg). So insert a dummy
copy_local between Op and its FI operand. This results in a redundant
copy which we should optimize away later (maybe in the post-FI-lowering
peephole pass).

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

llvm-svn: 260987
llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h
llvm/lib/Target/WebAssembly/known_gcc_test_failures.txt
llvm/test/CodeGen/WebAssembly/userstack.ll