[AMDGPU] fixed underflow in getOccupancyWithNumVGPRs
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Thu, 19 Sep 2019 20:09:04 +0000 (20:09 +0000)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Thu, 19 Sep 2019 20:09:04 +0000 (20:09 +0000)
commitd487d6401d98ba7a759cd069b61ae67b286a3014
tree741bb5a455ee1242abc293d2153c2484609d735e
parent1796aad50ca5de2447fdee5f22ce6f6a6379197f
[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

llvm-svn: 372350
llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp