[WebAssembly] Implement prolog/epilog insertion and FrameIndex elimination
authorDerek Schuff <dschuff@google.com>
Fri, 11 Dec 2015 23:49:46 +0000 (23:49 +0000)
committerDerek Schuff <dschuff@google.com>
Fri, 11 Dec 2015 23:49:46 +0000 (23:49 +0000)
commite8d6789f06c1b0655a61cebcf6d03934897dd272
tree8a0a1c433e4977887e0e7b93951f08045a160034
parent3c55c7bc30f513dd1544b3846e1204eb959f40e2
[WebAssembly]  Implement prolog/epilog insertion and FrameIndex elimination

Summary:
Use the SP32 physical register as the base for FrameIndex
lowering. Update it and the __stack_pointer global var in the prolog and
epilog. Extend the mapping of virtual registers to wasm locals to
include the physical registers.

Rather than modify the target-independent PrologEpilogInserter (which
asserts that there are no virtual registers left) include a
slightly-modified copy for Wasm that does not have this assertion and
only clears the virtual registers if scavenging was needed (which of
course it isn't for wasm).

Differential Revision: http://reviews.llvm.org/D15344

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255392 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
lib/Target/WebAssembly/CMakeLists.txt
lib/Target/WebAssembly/WebAssembly.h
lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp
lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
lib/Target/WebAssembly/WebAssemblyISelLowering.h
lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h
lib/Target/WebAssembly/WebAssemblyPEI.cpp [new file with mode: 0644]
lib/Target/WebAssembly/WebAssemblyPeephole.cpp
lib/Target/WebAssembly/WebAssemblyRegNumbering.cpp
lib/Target/WebAssembly/WebAssemblyRegisterInfo.cpp
lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
test/CodeGen/WebAssembly/userstack.ll [new file with mode: 0644]