This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Insert COPY_LOCAL between CopyToReg and FrameIndex DAG nodes
ClosedPublic

Authored by dschuff on Feb 12 2016, 1:24 PM.

Details

Summary

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).

Diff Detail

Event Timeline

dschuff updated this revision to Diff 47848.Feb 12 2016, 1:24 PM
dschuff retitled this revision from to [WebAssembly] Insert COPY_LOCAL between CopyToReg and FrameIndex DAG nodes.
dschuff updated this object.
dschuff added reviewers: sunfish, jfb.
dschuff added a subscriber: llvm-commits.
sunfish accepted this revision.Feb 16 2016, 8:30 AM
sunfish edited edge metadata.

As you say, we may need to revisit this when we're ready to start optimizing this, but this looks good for now.

This revision is now accepted and ready to land.Feb 16 2016, 8:30 AM
This revision was automatically updated to reflect the committed changes.