This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Use the frame pointer instead of the stack pointer
ClosedPublic

Authored by jgravelle-google on Sep 23 2016, 4:35 PM.

Details

Summary

When we have dynamic allcoas we need a frame pointer, and when we're lowering frame indexes we should make sure we use it.

Diff Detail

Repository
rL LLVM

Event Timeline

jgravelle-google retitled this revision from to Use the frame pointer instead of the stack pointer.
jgravelle-google updated this object.
jgravelle-google retitled this revision from Use the frame pointer instead of the stack pointer to [WebAssembly] Use the frame pointer instead of the stack pointer.Sep 23 2016, 4:42 PM
jgravelle-google updated this object.
dschuff added inline comments.Sep 26 2016, 10:08 AM
lib/Target/WebAssembly/WebAssemblyRegisterInfo.cpp
69 ↗(On Diff #72380)

how about "and don't use FrameIndex operands"

test/CodeGen/WebAssembly/userstack.ll
185 ↗(On Diff #72380)

This comment is a little confusing to me. Is it just referring to the copy_local/tee_local hop?

211 ↗(On Diff #72380)

Maybe add another comment line something like "Ensure that the addressing is still correct after the second SP adjustment"

lib/Target/WebAssembly/WebAssemblyRegisterInfo.cpp
69 ↗(On Diff #72380)

Sounds good.

test/CodeGen/WebAssembly/userstack.ll
185 ↗(On Diff #72380)

I think so? It's confusing to me as well, and seems wholly redundant. Will remove.

Modified comments, made unit test slightly stricter

Hopefully include both commits in this patch

dschuff accepted this revision.Sep 26 2016, 2:12 PM
dschuff edited edge metadata.
This revision is now accepted and ready to land.Sep 26 2016, 2:13 PM
This revision was automatically updated to reflect the committed changes.