OSDN Git Service

[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)
commit718d992d1fd9593a7d52bbf0cdc96946ed50b1ef
treec196f467530d2ff3f203a1f47033a7aa82e03965
parentfddbd94e1db4ab45eff7bbb1b1f7e63b5896b41b
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261579 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp
test/CodeGen/WebAssembly/userstack.ll