[mips] Use function TargetInstrInfo::getRegClass.
authorAkira Hatanaka <ahatanaka@mips.com>
Tue, 11 Jun 2013 18:48:16 +0000 (18:48 +0000)
committerAkira Hatanaka <ahatanaka@mips.com>
Tue, 11 Jun 2013 18:48:16 +0000 (18:48 +0000)
No functionality changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183767 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/MipsSEInstrInfo.cpp
lib/Target/Mips/MipsSEInstrInfo.h

index dc453dec3214f781bfa7196fda3900e58c9e3aef..e2a33ddb6968cf908b40738b2027858b800d4057 100644 (file)
@@ -389,12 +389,14 @@ void MipsSEInstrInfo::expandRetRA(MachineBasicBlock &MBB,
   BuildMI(MBB, I, I->getDebugLoc(), get(Opc)).addReg(Mips::RA);
 }
 
-std::pair<bool, bool> MipsSEInstrInfo::compareOpndSize(unsigned Opc) const {
+std::pair<bool, bool>
+MipsSEInstrInfo::compareOpndSize(unsigned Opc,
+                                 const MachineFunction &MF) const {
   const MCInstrDesc &Desc = get(Opc);
   assert(Desc.NumOperands == 2 && "Unary instruction expected.");
-  const MipsRegisterInfo &RI = getRegisterInfo();
-  unsigned DstRegSize = RI.getRegClass(Desc.OpInfo[0].RegClass)->getSize();
-  unsigned SrcRegSize = RI.getRegClass(Desc.OpInfo[1].RegClass)->getSize();
+  const MipsRegisterInfo *RI = &getRegisterInfo();
+  unsigned DstRegSize = getRegClass(Desc, 0, RI, MF)->getSize();
+  unsigned SrcRegSize = getRegClass(Desc, 1, RI, MF)->getSize();
 
   return std::make_pair(DstRegSize > SrcRegSize, DstRegSize < SrcRegSize);
 }
@@ -411,7 +413,7 @@ void MipsSEInstrInfo::expandCvtFPInt(MachineBasicBlock &MBB,
   unsigned SubIdx = (IsI64 ? Mips::sub_32 : Mips::sub_fpeven);
   bool DstIsLarger, SrcIsLarger;
 
-  tie(DstIsLarger, SrcIsLarger) = compareOpndSize(CvtOpc);
+  tie(DstIsLarger, SrcIsLarger) = compareOpndSize(CvtOpc, *MBB.getParent());
 
   if (DstIsLarger)
     TmpReg = getRegisterInfo().getSubReg(DstReg, SubIdx);
index 551e4e58ba8b06d8463e638a195e750b7d18d12f..d962ef0eb9cd0cc68ddf25c586df8c325b3ed6ba 100644 (file)
@@ -84,7 +84,8 @@ private:
   void expandRetRA(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
                    unsigned Opc) const;
 
-  std::pair<bool, bool> compareOpndSize(unsigned Opc) const;
+  std::pair<bool, bool> compareOpndSize(unsigned Opc,
+                                        const MachineFunction &MF) const;
 
   /// Expand pseudo Int-to-FP conversion instructions.
   ///