[clang] [llvm] [SPARC] Support reserving arbitrary general purpose registers (PR #74927)

Sergei Barannikov via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 9 01:14:16 PST 2024


================
@@ -82,6 +88,13 @@ class SparcSubtarget : public SparcGenSubtargetInfo {
     return is64Bit() ? 2047 : 0;
   }
 
+  bool isRegisterReserved(MCPhysReg PhysReg) const {
+    if (PhysReg >= SP::G0 && PhysReg <= SP::O7)
+      return ReserveRegister[PhysReg - SP::G0];
----------------
s-barannikov wrote:

I think so. `MRI::getNumRegs()` used in `SparcRegisterInfo::getReservedRegs()` returns the same value.


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


More information about the cfe-commits mailing list