diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2025-03-06 09:17:51 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-06 09:17:51 +0700 |
commit | a216358ce7e8c4b8b4f99f92426a94e558c6ffed (patch) | |
tree | ad48fc62c1ee5c680a36f8f04e5596f6f100bb53 /llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp | |
parent | f4ba2bf236c1f6243420ae4872accc350af98624 (diff) | |
download | llvm-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.cpp | 5 |
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; } |