Skip to content

Commit f2c130c

Browse files
committed
Rename to amdgpu-agpr-alloc, but having a hard time finding a good name
1 parent d51dfb8 commit f2c130c

File tree

4 files changed

+47
-45
lines changed

4 files changed

+47
-45
lines changed

llvm/docs/AMDGPUUsage.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,11 +1707,13 @@ The AMDGPU backend supports the following LLVM IR attributes.
17071707
as hidden. Hidden arguments are managed by the compiler and are not part of
17081708
the explicit arguments supplied by the user.
17091709

1710-
"amdgpu-num-agpr"="min(,max)" Indicates a minimum and maximum range for the number of AGPRs to make
1710+
"amdgpu-agpr-alloc"="min(,max)" Indicates a minimum and maximum range for the number of AGPRs to make
17111711
available to allocate. The values will be rounded up to the next multiple
17121712
of the allocation granularity (4). The minimum value is interpreted as the
1713-
minimum number of AGPRs the function will require to allocate. If only one
1714-
value is specified, it is interpreted as the minimum register budget.
1713+
minimum required number of AGPRs for the function to allocate (that is, the
1714+
function requires no more than min registers). If only one value is specified,
1715+
it is interpreted as the minimum register budget. The maximum will restrict
1716+
allocation to use no more than max AGPRs.
17151717

17161718
The values may be ignored if satisfying it would violate other allocation
17171719
constraints.

llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,13 +592,13 @@ SIRegisterInfo::getMaxNumVectorRegs(const MachineFunction &MF) const {
592592

593593
const std::pair<unsigned, unsigned> DefaultNumAGPR = {~0u, ~0u};
594594

595-
// TODO: Replace amdgpu-no-agpr with amdgpu-num-agpr=0
595+
// TODO: Replace amdgpu-no-agpr with amdgpu-agpr-alloc=0
596596
// TODO: Move this logic into subtarget on IR function
597597
//
598598
// TODO: The lower bound should probably force the number of required
599599
// registers up, overriding amdgpu-waves-per-eu.
600600
std::tie(MinNumAGPRs, MaxNumAGPRs) = AMDGPU::getIntegerPairAttribute(
601-
MF.getFunction(), "amdgpu-num-agpr", DefaultNumAGPR,
601+
MF.getFunction(), "amdgpu-agpr-alloc", DefaultNumAGPR,
602602
/*OnlyFirstRequired=*/true);
603603

604604
if (MinNumAGPRs == DefaultNumAGPR.first) {

llvm/test/CodeGen/AMDGPU/amdgpu-no-agprs-violations.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
; RUN: FileCheck -check-prefix=ERR < %t.err %s
44

55
; Test undefined behavior where a function ends up needing AGPRs that
6-
; was marked with "amdgpu-num-agpr="="0". There should be no asserts.
6+
; was marked with "amdgpu-agpr-alloc="="0". There should be no asserts.
77

88
; TODO: Should this be an error, or let UB happen?
99

@@ -46,4 +46,4 @@ define amdgpu_kernel void @kernel_calls_mfma.f32.32x32x1f32(ptr addrspace(1) %ou
4646
ret void
4747
}
4848

49-
attributes #0 = { "amdgpu-num-agpr"="0" }
49+
attributes #0 = { "amdgpu-agpr-alloc"="0" }

0 commit comments

Comments
 (0)