This is an archive of the discontinued LLVM Phabricator instance.

WIP for further user stack pointer functionality
ClosedPublic

Authored by dschuff on Dec 16 2015, 1:57 PM.

Details

Summary

Implement eliminateCallFramePsuedo to handle ADJCALLSTACKUP/DOWN
pseudo-instructions. Add a test calling a vararg function which causes non-0
adjustments. This revealed an issue with RegisterCoalescer wherein it
eliminates a COPY from SP32 to a vreg but failes to update the live ranges
of EXPR_STACK, causing a machineinstr verifier failure.

Also add a dynamic alloca test, which causes a callseq_end dag node with
a 0 (instead of undef) second argument to be generated. We currently fail to
select that, so adjust the ADJCALLSTACKUP tablegen code to handle it.

Diff Detail

Repository
rL LLVM

Event Timeline

dschuff updated this revision to Diff 43061.Dec 16 2015, 1:57 PM
dschuff retitled this revision from to WIP for further user stack pointer functionality.
dschuff updated this object.
dschuff added reviewers: jfb, sunfish.
sunfish accepted this revision.Dec 16 2015, 2:36 PM
sunfish edited edge metadata.

lgtm, with a few minor comments. This is a step forward.

lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp
66 ↗(On Diff #43061)

This function can be 'static'.

lib/Target/WebAssembly/WebAssemblyInstrCall.td
53 ↗(On Diff #43061)

Ah, it seems SelectionDAG is creating its own CALLSEQ_END nodes and passing them zeros. In that case, I think it'd be better to change the one place in WebAssemblyISelLowering.cpp which creates a CALLSEQ_END node to pass a zero instead of an undef, so that we don't need this pattern here for matching an undef.

lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
130 ↗(On Diff #43061)

It's unconventional in LLVM to have extra blank lines.

This revision is now accepted and ready to land.Dec 16 2015, 2:36 PM
dschuff updated this revision to Diff 43073.Dec 16 2015, 3:22 PM
dschuff marked 3 inline comments as done.
dschuff edited edge metadata.

Address comments, make tests pass

This revision was automatically updated to reflect the committed changes.