]> granicus.if.org Git - llvm/commit
[AArch64] Static (de)allocation of SVE stack objects.
authorSander de Smalen <sander.desmalen@arm.com>
Thu, 3 Oct 2019 11:33:50 +0000 (11:33 +0000)
committerSander de Smalen <sander.desmalen@arm.com>
Thu, 3 Oct 2019 11:33:50 +0000 (11:33 +0000)
commit3e9f78170eb0c485d07e5006987835c1917e81f2
treefadd82a5b99fb50681cc46f139c17b32caee917b
parent98389cce9dc0098dcef412fec023391868dd5566
[AArch64] Static (de)allocation of SVE stack objects.

Adds support to AArch64FrameLowering to allocate fixed-stack SVE objects.

The focus of this patch is purely to allow the stack frame to
allocate/deallocate space for scalable SVE objects. More dynamic
allocation (at compile-time, i.e. determining placement of SVE objects
on the stack), or resolving frame-index references that include
scalable-sized offsets, are left for subsequent patches.

SVE objects are allocated in the stack frame as a separate region below
the callee-save area, and above the alignment gap. This is done so that
the SVE objects can be accessed directly from the FP at (runtime)
VL-based offsets to benefit from using the VL-scaled addressing modes.

The layout looks as follows:

     +-------------+
     | stack arg   |
     +-------------+
     | Callee Saves|
     |   X29, X30  |       (if available)
     |-------------| <- FP (if available)
     |     :       |
     |  SVE area   |
     |     :       |
     +-------------+
     |/////////////| alignment gap.
     |     :       |
     | Stack objs  |
     |     :       |
     +-------------+ <- SP after call and frame-setup

SVE and non-SVE stack objects are distinguished using different
StackIDs. The offsets for objects with TargetStackID::SVEVector should be
interpreted as purely scalable offsets within their respective SVE region.

Reviewers: thegameg, rovka, t.p.northover, efriedma, rengolin, greened

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D61437

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373585 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MIRYamlMapping.h
include/llvm/CodeGen/TargetFrameLowering.h
lib/Target/AArch64/AArch64FrameLowering.cpp
lib/Target/AArch64/AArch64FrameLowering.h
lib/Target/AArch64/AArch64InstrInfo.cpp
lib/Target/AArch64/AArch64MachineFunctionInfo.h
lib/Target/AArch64/AArch64StackOffset.h
lib/Target/AMDGPU/SIFrameLowering.cpp
test/CodeGen/AArch64/framelayout-sve.mir [new file with mode: 0644]
unittests/Target/AArch64/TestStackOffset.cpp