[llvm] r178359 - [mips] Define a function which returns the GPR register class.
Akira Hatanaka
ahatanaka at mips.com
Fri Mar 29 12:17:42 PDT 2013
Author: ahatanak
Date: Fri Mar 29 14:17:42 2013
New Revision: 178359
URL: http://llvm.org/viewvc/llvm-project?rev=178359&view=rev
Log:
[mips] Define a function which returns the GPR register class.
Modified:
llvm/trunk/lib/Target/Mips/Mips16RegisterInfo.cpp
llvm/trunk/lib/Target/Mips/Mips16RegisterInfo.h
llvm/trunk/lib/Target/Mips/MipsRegisterInfo.h
llvm/trunk/lib/Target/Mips/MipsSERegisterInfo.cpp
llvm/trunk/lib/Target/Mips/MipsSERegisterInfo.h
Modified: llvm/trunk/lib/Target/Mips/Mips16RegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/Mips16RegisterInfo.cpp?rev=178359&r1=178358&r2=178359&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/Mips16RegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/Mips/Mips16RegisterInfo.cpp Fri Mar 29 14:17:42 2013
@@ -72,6 +72,12 @@ bool Mips16RegisterInfo::saveScavengerRe
return true;
}
+const TargetRegisterClass *
+Mips16RegisterInfo::intRegClass(unsigned Size) const {
+ assert(Size == 4);
+ return &Mips::CPU16RegsRegClass;
+}
+
void Mips16RegisterInfo::eliminateFI(MachineBasicBlock::iterator II,
unsigned OpNo, int FrameIndex,
uint64_t StackSize,
Modified: llvm/trunk/lib/Target/Mips/Mips16RegisterInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/Mips16RegisterInfo.h?rev=178359&r1=178358&r2=178359&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/Mips16RegisterInfo.h (original)
+++ llvm/trunk/lib/Target/Mips/Mips16RegisterInfo.h Fri Mar 29 14:17:42 2013
@@ -37,6 +37,8 @@ public:
const TargetRegisterClass *RC,
unsigned Reg) const;
+ virtual const TargetRegisterClass *intRegClass(unsigned Size) const;
+
private:
virtual void eliminateFI(MachineBasicBlock::iterator II, unsigned OpNo,
int FrameIndex, uint64_t StackSize,
Modified: llvm/trunk/lib/Target/Mips/MipsRegisterInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsRegisterInfo.h?rev=178359&r1=178358&r2=178359&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsRegisterInfo.h (original)
+++ llvm/trunk/lib/Target/Mips/MipsRegisterInfo.h Fri Mar 29 14:17:42 2013
@@ -68,6 +68,9 @@ public:
unsigned getEHExceptionRegister() const;
unsigned getEHHandlerRegister() const;
+ /// \brief Return GPR register class.
+ virtual const TargetRegisterClass *intRegClass(unsigned Size) const = 0;
+
private:
virtual void eliminateFI(MachineBasicBlock::iterator II, unsigned OpNo,
int FrameIndex, uint64_t StackSize,
Modified: llvm/trunk/lib/Target/Mips/MipsSERegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsSERegisterInfo.cpp?rev=178359&r1=178358&r2=178359&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsSERegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsSERegisterInfo.cpp Fri Mar 29 14:17:42 2013
@@ -54,6 +54,15 @@ requiresFrameIndexScavenging(const Machi
return true;
}
+const TargetRegisterClass *
+MipsSERegisterInfo::intRegClass(unsigned Size) const {
+ if (Size == 4)
+ return &Mips::CPURegsRegClass;
+
+ assert(Size == 8);
+ return &Mips::CPU64RegsRegClass;
+}
+
void MipsSERegisterInfo::eliminateFI(MachineBasicBlock::iterator II,
unsigned OpNo, int FrameIndex,
uint64_t StackSize,
Modified: llvm/trunk/lib/Target/Mips/MipsSERegisterInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsSERegisterInfo.h?rev=178359&r1=178358&r2=178359&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsSERegisterInfo.h (original)
+++ llvm/trunk/lib/Target/Mips/MipsSERegisterInfo.h Fri Mar 29 14:17:42 2013
@@ -31,6 +31,8 @@ public:
bool requiresFrameIndexScavenging(const MachineFunction &MF) const;
+ virtual const TargetRegisterClass *intRegClass(unsigned Size) const;
+
private:
virtual void eliminateFI(MachineBasicBlock::iterator II, unsigned OpNo,
int FrameIndex, uint64_t StackSize,
More information about the llvm-commits
mailing list