Fix stack pointer identification for wasm::ABI::getStackSpace().#2243
Fix stack pointer identification for wasm::ABI::getStackSpace().#2243kripken merged 6 commits intoWebAssembly:masterfrom
Conversation
Recent stack pointer simplification in Emscripten broke the --spill-pointers pass. This fix for WebAssembly#2229 restores this functionality by recognizing an alternative coding idiom in Emscripten-generated WASM code.
There was a problem hiding this comment.
Thanks for the PR @wmaddox!
There is still the issue of the stack direction - the current code assumes the stack goes up, but in the wasm backend it goes down. I'm not sure how best to handle that - one option is to make SpillPointers aware of it (a variant with a downward stack), another is to add a PassOption, as this might be relevant for other places too eventually.
kripken
left a comment
There was a problem hiding this comment.
Thanks @wmaddox!
Looks good, two final comments below, and also please add a test for this: there is test/passes/spill-pointers.wast already, can add another module right after it in the same file, then after running ./auto_update_tests.py it will update the expected output with that.
|
Perfect, thanks @wmaddox! |
Recent stack pointer simplification in Emscripten broke the --spill-pointers
pass. This fix for #2229 restores this functionality by recognizing an
alternative coding idiom in Emscripten-generated WASM code.