[llvm] [NFC][AMDGPU] Compute always reserved registers once (PR #132006)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 9 03:15:00 PDT 2025
================
@@ -629,12 +629,16 @@ SIRegisterInfo::getMaxNumVectorRegs(const MachineFunction &MF) const {
return std::pair(MaxNumVGPRs, MaxNumAGPRs);
}
-BitVector SIRegisterInfo::getReservedRegs(const MachineFunction &MF) const {
- BitVector Reserved(getNumRegs());
+BitVector SIRegisterInfo::getAlwaysReservedRegs() const {
+ static BitVector AlwaysReservedRegs;
+ // Already been calculated, so do not compute again.
+ if (AlwaysReservedRegs.size() == getNumRegs())
----------------
jayfoad wrote:
Doesn't this need to be done in a thread-safe way??
https://github.com/llvm/llvm-project/pull/132006
More information about the llvm-commits
mailing list