aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
diff options
context:
space:
mode:
authorDiana Picus <Diana-Magda.Picus@amd.com>2025-06-24 11:09:36 +0200
committerGitHub <noreply@github.com>2025-06-24 11:09:36 +0200
commita201f8872a63aa336e4f79a40e196b6c20c9001e (patch)
tree98d0ca031c01c13cb0a958b0dd36c46bbff0aa26 /llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
parent6cfa03f1f1d9351950b6d12fb923ce7e2cb3405b (diff)
downloadllvm-a201f8872a63aa336e4f79a40e196b6c20c9001e.zip
llvm-a201f8872a63aa336e4f79a40e196b6c20c9001e.tar.gz
llvm-a201f8872a63aa336e4f79a40e196b6c20c9001e.tar.bz2
[AMDGPU] Replace dynamic VGPR feature with attribute (#133444)
Use a function attribute (amdgpu-dynamic-vgpr) instead of a subtarget feature, as requested in #130030.
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
index 1673bfa..67ad286 100644
--- a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
@@ -48,6 +48,12 @@ SIMachineFunctionInfo::SIMachineFunctionInfo(const Function &F,
MaxNumWorkGroups = ST.getMaxNumWorkGroups(F);
assert(MaxNumWorkGroups.size() == 3);
+ // Temporarily check both the attribute and the subtarget feature, until the
+ // latter is completely removed.
+ DynamicVGPRBlockSize = AMDGPU::getDynamicVGPRBlockSize(F);
+ if (DynamicVGPRBlockSize == 0 && ST.isDynamicVGPREnabled())
+ DynamicVGPRBlockSize = ST.getDynamicVGPRBlockSize();
+
Occupancy = ST.computeOccupancy(F, getLDSSize()).second;
CallingConv::ID CC = F.getCallingConv();
@@ -716,6 +722,7 @@ yaml::SIMachineFunctionInfo::SIMachineFunctionInfo(
PSInputAddr(MFI.getPSInputAddr()), PSInputEnable(MFI.getPSInputEnable()),
MaxMemoryClusterDWords(MFI.getMaxMemoryClusterDWords()),
Mode(MFI.getMode()), HasInitWholeWave(MFI.hasInitWholeWave()),
+ DynamicVGPRBlockSize(MFI.getDynamicVGPRBlockSize()),
ScratchReservedForDynamicVGPRs(MFI.getScratchReservedForDynamicVGPRs()) {
for (Register Reg : MFI.getSGPRSpillPhysVGPRs())
SpillPhysVGPRS.push_back(regToString(Reg, TRI));