HomePhabricator

[WebAssembly] Fix ADJCALLSTACKDOWN/UP use/defs

Description

[WebAssembly] Fix ADJCALLSTACKDOWN/UP use/defs

Summary:
ADJCALLSTACK{DOWN,UP} (aka CALLSEQ_{START,END}) MIs are supposed to use
and def the stack pointer. Since they do not, all the nodes are being
eliminated by DeadMachineInstructionElim, so they aren't in the IR when
PrologEpilogInserter/eliminateCallFramePseudo needs them.

This change fixes that, but since RegStackify will not stackify across
them (and it runs early, before PEI), change LowerCall to only emit them
when the call frame size is > 0. That makes the current code work the
same way and makes code handled by D15344 also work the same way. We can
expand the condition beyond NumBytes > 0 in the future if needed.

Reviewers: sunfish, jfb

Subscribers: jfb, dschuff, llvm-commits

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

Details

Committed
dschuffDec 11 2015, 10:55 AM
Differential Revision
D15459: [WebAssembly] Fix ADJCALLSTACKDOWN/UP use/defs
Parents
rL255355: Discard local symbols from SHF_MERGE sections.
Branches
Unknown
Tags
Unknown