[WebAssembly] Fix writeback of stack pointer with dynamic alloca
authorDerek Schuff <dschuff@google.com>
Mon, 22 Feb 2016 21:57:17 +0000 (21:57 +0000)
committerDerek Schuff <dschuff@google.com>
Mon, 22 Feb 2016 21:57:17 +0000 (21:57 +0000)
commit27e3b8a6e3a5c75a0e23d18a7bb3f32bce851db8
tree7c1d816cf9179850ab0f110b01df51867c61b57e
parentfb31d580ea5e887159a1bc684a357a7b2e27e123
[WebAssembly] Fix writeback of stack pointer with dynamic alloca

Previously the stack pointer was only written back to memory in the
prolog. But this is wrong for dynamic allocas, for which
target-independent codegen handles SP updates after the prolog (and
possibly even in another BB). Instead update the SP global in
ADJCALLSTACKDOWN which is generated after the SP update sequence.
This will have further refinements when we add red zone support.

llvm-svn: 261579
llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp
llvm/test/CodeGen/WebAssembly/userstack.ll