[llvm] [AMDGPU] Speed up SIRegisterInfo::getReservedRegs (PR #79844)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 29 09:27:14 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);
+ for (MCPhysReg Reg : *RC) {
----------------
arsenm wrote:
I think you can get away with drop_front. Plus I still think we should move reserved regs to be stored as reserved reg units
https://github.com/llvm/llvm-project/pull/79844
More information about the llvm-commits
mailing list