[llvm] [AMDGPU] Speed up SIRegisterInfo::getReservedRegs (PR #79610)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 30 03:31:01 PST 2024
================
@@ -622,9 +622,15 @@ BitVector SIRegisterInfo::getReservedRegs(const MachineFunction &MF) const {
//
unsigned MaxNumSGPRs = ST.getMaxNumSGPRs(MF);
unsigned TotalNumSGPRs = AMDGPU::SGPR_32RegClass.getNumRegs();
- for (unsigned i = MaxNumSGPRs; i < TotalNumSGPRs; ++i) {
- unsigned Reg = AMDGPU::SGPR_32RegClass.getRegister(i);
- reserveRegisterTuples(Reserved, Reg);
+ for (const TargetRegisterClass *RC : regclasses()) {
+ if (RC->isBaseClass() && isSGPRClass(RC)) {
+ unsigned NumRegs = divideCeil(getRegSizeInBits(*RC), 32);
----------------
jayfoad wrote:
No, here I want the number of 32-bit VGPRs in each register tuple in the class.
https://github.com/llvm/llvm-project/pull/79610
More information about the llvm-commits
mailing list