OSDN Git Service

[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)
commitcd66f7a1e9461e5357b236b9b02d8217b573344c
treee738fb1e5a1c9fa748cfee86dd434e5627e3917a
parentf4f96b9ce55d0cd77ef1dcdf6d6c2b6be5e53a2e
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260987 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
lib/Target/WebAssembly/WebAssemblyISelLowering.h
lib/Target/WebAssembly/known_gcc_test_failures.txt
test/CodeGen/WebAssembly/userstack.ll