aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
diff options
context:
space:
mode:
authorDavid Sherwood <david.sherwood@arm.com>2020-07-14 16:20:00 +0100
committerDavid Sherwood <david.sherwood@arm.com>2020-07-27 08:22:01 +0100
commit14bc85e0ebb6c00c1672158ab6a692bfbb11e1cc (patch)
tree264250511934fd45b3831f8f4a78ab363fbd2ec1 /llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
parentf2ab2134c7c4949eea3f6ddd35bcea236fe12592 (diff)
downloadllvm-14bc85e0ebb6c00c1672158ab6a692bfbb11e1cc.zip
llvm-14bc85e0ebb6c00c1672158ab6a692bfbb11e1cc.tar.gz
llvm-14bc85e0ebb6c00c1672158ab6a692bfbb11e1cc.tar.bz2
[SVE] Don't use LocalStackAllocation for SVE objects
I have introduced a new TargetFrameLowering query function: isStackIdSafeForLocalArea that queries whether or not it is safe for objects of a given stack id to be bundled into the local area. The default behaviour is to always bundle regardless of the stack id, however for AArch64 this is overriden so that it's only safe for fixed-size stack objects. There is future work here to extend this algorithm for multiple local areas so that SVE stack objects can be bundled together and accessed from their own virtual base-pointer. Differential Revision: https://reviews.llvm.org/D83859
Diffstat (limited to 'llvm/lib/CodeGen/LocalStackSlotAllocation.cpp')
-rw-r--r--llvm/lib/CodeGen/LocalStackSlotAllocation.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp b/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
index 6c5ef02..204fb55 100644
--- a/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
+++ b/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
@@ -220,6 +220,8 @@ void LocalStackSlotPass::calculateFrameObjectOffsets(MachineFunction &Fn) {
continue;
if (StackProtectorFI == (int)i)
continue;
+ if (!TFI.isStackIdSafeForLocalArea(MFI.getStackID(i)))
+ continue;
switch (MFI.getObjectSSPLayout(i)) {
case MachineFrameInfo::SSPLK_None:
@@ -254,6 +256,8 @@ void LocalStackSlotPass::calculateFrameObjectOffsets(MachineFunction &Fn) {
continue;
if (ProtectedObjs.count(i))
continue;
+ if (!TFI.isStackIdSafeForLocalArea(MFI.getStackID(i)))
+ continue;
AdjustStackOffset(MFI, i, Offset, StackGrowsDown, MaxAlign);
}