[llvm] [AMDGPU] Have VCC as a first-class member of the SGPR pool. (PR #173870)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 5 06:32:32 PST 2026


jayfoad wrote:

I am surpised that this does not cause any changes due to the way `AMDGPUResourceUsageAnalysis` counts the number of SGPRs used:
```
  Info.UsesVCC =
      MRI.isPhysRegUsed(AMDGPU::VCC_LO) || MRI.isPhysRegUsed(AMDGPU::VCC_HI);
  Info.NumExplicitSGPR = TRI.getNumUsedPhysRegs(MRI, AMDGPU::SGPR_32RegClass,
                                                /*IncludeCalls=*/false);
```
After your patch NumExplicitSGPR will include any VCC usage, right?

I am also a little nervous about any code that explicitly checks for operands being == VCC or == VCC_LO, like the isVCC helper functions in `AMDGPUWaitSGPRHazards` and `GCNHazardRecognizer`. Perhaps they now need to check for any tuple that includes VCC?

https://github.com/llvm/llvm-project/pull/173870


More information about the llvm-commits mailing list