mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-07 19:19:26 +00:00
[AMDGPU] fixed underflow in getOccupancyWithNumVGPRs
The function could return zero if an extreme number or registers were used. Minimal possible occupancy is 1. Differential Revision: https://reviews.llvm.org/D67771 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372350 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
72bcb2596e
commit
a36690edb4
@ -599,7 +599,7 @@ unsigned GCNSubtarget::getOccupancyWithNumVGPRs(unsigned VGPRs) const {
|
||||
if (VGPRs < Granule)
|
||||
return MaxWaves;
|
||||
unsigned RoundedRegs = ((VGPRs + Granule - 1) / Granule) * Granule;
|
||||
return std::min(getTotalNumVGPRs() / RoundedRegs, MaxWaves);
|
||||
return std::min(std::max(getTotalNumVGPRs() / RoundedRegs, 1u), MaxWaves);
|
||||
}
|
||||
|
||||
unsigned GCNSubtarget::getReservedNumSGPRs(const MachineFunction &MF) const {
|
||||
|
Loading…
x
Reference in New Issue
Block a user