aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2025-03-06 09:17:51 +0700
committerGitHub <noreply@github.com>2025-03-06 09:17:51 +0700
commita216358ce7e8c4b8b4f99f92426a94e558c6ffed (patch)
treead48fc62c1ee5c680a36f8f04e5596f6f100bb53 /llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
parentf4ba2bf236c1f6243420ae4872accc350af98624 (diff)
downloadllvm-a216358ce7e8c4b8b4f99f92426a94e558c6ffed.zip
llvm-a216358ce7e8c4b8b4f99f92426a94e558c6ffed.tar.gz
llvm-a216358ce7e8c4b8b4f99f92426a94e558c6ffed.tar.bz2
AMDGPU: Replace amdgpu-no-agpr with amdgpu-agpr-alloc (#129893)
This performs the minimal replacment of amdgpu-no-agpr to amdgpu-agpr-alloc=0. Most of the test diffs are due to the new attribute sorting later alphabetically. We could do better by trying to perform range merging in the attributor, and trying to pick non-0 values.
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
index a83fc2d..abd19c9 100644
--- a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
@@ -780,5 +780,8 @@ bool SIMachineFunctionInfo::initializeBaseYamlFields(
}
bool SIMachineFunctionInfo::mayUseAGPRs(const Function &F) const {
- return !F.hasFnAttribute("amdgpu-no-agpr");
+ auto [MinNumAGPR, MaxNumAGPR] =
+ AMDGPU::getIntegerPairAttribute(F, "amdgpu-agpr-alloc", {~0u, ~0u},
+ /*OnlyFirstRequired=*/true);
+ return MinNumAGPR != 0u;
}