Skip to content

Commit 1da8eb8

Browse files
Remove unneeded calculations and rename functions
1 parent 6e5695b commit 1da8eb8

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,10 +1360,6 @@ void GCNSchedStage::checkScheduling() {
13601360
unsigned MaxArchVGPRs = std::min(MaxVGPRs, ST.getAddressableNumArchVGPRs());
13611361
unsigned MaxSGPRs = ST.getMaxNumSGPRs(MF);
13621362

1363-
unsigned MaxAGPRs = ST.getMaxNumAGPRs(MF, MaxArchVGPRs, WavesAfter);
1364-
1365-
assert(MaxAGPRs + MaxArchVGPRs == MaxVGPRs);
1366-
13671363
if (PressureAfter.getVGPRNum(ST.hasGFX90AInsts()) > MaxVGPRs ||
13681364
PressureAfter.getArchVGPRNum() > MaxArchVGPRs ||
13691365
PressureAfter.getAGPRNum() > MaxArchVGPRs ||

llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,6 +1508,8 @@ unsigned getMaxNumAGPRs(const MCSubtargetInfo *STI, unsigned int WavesPerEU) {
15081508
return std::min(MaxNumAGPRs, AddressableNumAGPRs);
15091509
}
15101510

1511+
unsigned getAddressableNumAGPRs(const MCSubtargetInfo *STI) { return 256; }
1512+
15111513
unsigned getEncodedNumVGPRBlocks(const MCSubtargetInfo *STI, unsigned NumVGPRs,
15121514
std::optional<bool> EnableWavefrontSize32) {
15131515
return getGranulatedNumRegisterBlocks(

llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,14 +353,13 @@ unsigned getNumWavesPerEUWithNumVGPRs(unsigned NumVGPRs, unsigned Granule,
353353
unsigned MaxWaves,
354354
unsigned TotalNumVGPRs);
355355

356-
// TODO: Is this accurate for all subtargets?
357-
// Remove constexpr later
358-
constexpr unsigned getTotalNumAGPRs() { return 256; }
359-
360356
/// \returns Maximum number of AGPRs that meets given number of waves per
361357
/// execution unit requirement for given subtarget \p STI.
362358
unsigned getMaxNumAGPRs(const MCSubtargetInfo *STI, unsigned WavesPerEU);
363359

360+
/// \returns Addressable number of AGPRs for a given subtarget \p STI.
361+
unsigned getAddressableNumAGPRs(const MCSubtargetInfo *STI);
362+
364363
/// \returns Occupancy for a given \p SGPRs usage, \p MaxWaves possible, and \p
365364
/// Gen.
366365
unsigned getOccupancyWithNumSGPRs(unsigned SGPRs, unsigned MaxWaves,

0 commit comments

Comments
 (0)