aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
diff options
context:
space:
mode:
authorDiana Picus <Diana-Magda.Picus@amd.com>2024-02-09 09:20:25 +0100
committerGitHub <noreply@github.com>2024-02-09 09:20:25 +0100
commitbc6955f18ced3ca89d49bc28eeb58cd6d367e136 (patch)
tree89b0c061836621cde02b707c914568a6b0665a66 /llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
parentb477d39bf6811ac12a1e7e98f308cf4c9a8de26f (diff)
downloadllvm-bc6955f18ced3ca89d49bc28eeb58cd6d367e136.zip
llvm-bc6955f18ced3ca89d49bc28eeb58cd6d367e136.tar.gz
llvm-bc6955f18ced3ca89d49bc28eeb58cd6d367e136.tar.bz2
[AMDGPU] Don't fix the scavenge slot at offset 0 (#79136)
At the moment, the emergency spill slot is a fixed object for entry functions and chain functions, and a regular stack object otherwise. This patch adopts the latter behaviour for entry/chain functions too. It seems this was always the intention [1] and it will also save us a bit of stack space in cases where the first stack object has a large alignment. [1] https://github.com/llvm/llvm-project/commit/34c8b835b16fb3879f1b9770e91df21883356bb6
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
index b94d143..52d6fe6 100644
--- a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
@@ -552,14 +552,10 @@ int SIMachineFunctionInfo::getScavengeFI(MachineFrameInfo &MFI,
const SIRegisterInfo &TRI) {
if (ScavengeFI)
return *ScavengeFI;
- if (isBottomOfStack()) {
- ScavengeFI = MFI.CreateFixedObject(
- TRI.getSpillSize(AMDGPU::SGPR_32RegClass), 0, false);
- } else {
- ScavengeFI = MFI.CreateStackObject(
- TRI.getSpillSize(AMDGPU::SGPR_32RegClass),
- TRI.getSpillAlign(AMDGPU::SGPR_32RegClass), false);
- }
+
+ ScavengeFI =
+ MFI.CreateStackObject(TRI.getSpillSize(AMDGPU::SGPR_32RegClass),
+ TRI.getSpillAlign(AMDGPU::SGPR_32RegClass), false);
return *ScavengeFI;
}