Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[X86][NFC] Convert references to TargetRegisterInfo with pointers to align with rest of codebase #84345

Closed
wants to merge 1 commit into from

Conversation

AtariDreams
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 7, 2024

@llvm/pr-subscribers-backend-x86

Author: AtariDreams (AtariDreams)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/84345.diff

1 Files Affected:

  • (modified) llvm/lib/Target/X86/X86RegisterInfo.cpp (+6-6)
diff --git a/llvm/lib/Target/X86/X86RegisterInfo.cpp b/llvm/lib/Target/X86/X86RegisterInfo.cpp
index be0cf1596d0d90..15da770ead3853 100644
--- a/llvm/lib/Target/X86/X86RegisterInfo.cpp
+++ b/llvm/lib/Target/X86/X86RegisterInfo.cpp
@@ -669,9 +669,9 @@ unsigned X86RegisterInfo::getNumSupportedRegs(const MachineFunction &MF) const {
 bool X86RegisterInfo::isArgumentRegister(const MachineFunction &MF,
                                          MCRegister Reg) const {
   const X86Subtarget &ST = MF.getSubtarget<X86Subtarget>();
-  const TargetRegisterInfo &TRI = *ST.getRegisterInfo();
+  const TargetRegisterInfo *TRI = ST.getRegisterInfo();
   auto IsSubReg = [&](MCRegister RegA, MCRegister RegB) {
-    return TRI.isSuperOrSubRegisterEq(RegA, RegB);
+    return TRI->isSuperOrSubRegisterEq(RegA, RegB);
   };
 
   if (!ST.is64Bit())
@@ -708,15 +708,15 @@ bool X86RegisterInfo::isArgumentRegister(const MachineFunction &MF,
 bool X86RegisterInfo::isFixedRegister(const MachineFunction &MF,
                                       MCRegister PhysReg) const {
   const X86Subtarget &ST = MF.getSubtarget<X86Subtarget>();
-  const TargetRegisterInfo &TRI = *ST.getRegisterInfo();
+  const TargetRegisterInfo *TRI = ST.getRegisterInfo();
 
   // Stack pointer.
-  if (TRI.isSuperOrSubRegisterEq(X86::RSP, PhysReg))
+  if (TRI->isSuperOrSubRegisterEq(X86::RSP, PhysReg))
     return true;
 
   // Don't use the frame pointer if it's being used.
-  const X86FrameLowering &TFI = *getFrameLowering(MF);
-  if (TFI.hasFP(MF) && TRI.isSuperOrSubRegisterEq(X86::RBP, PhysReg))
+  const X86FrameLowering *TFI = getFrameLowering(MF);
+  if (TFI->hasFP(MF) && TRI->isSuperOrSubRegisterEq(X86::RBP, PhysReg))
     return true;
 
   return X86GenRegisterInfo::isFixedRegister(MF, PhysReg);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants