diff options
author | Akira Hatanaka <ahatanaka@mips.com> | 2013-06-11 18:48:16 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@mips.com> | 2013-06-11 18:48:16 +0000 |
commit | 4be04b139b94e8a4f1e2033bb7693613ca26a994 (patch) | |
tree | bea86434e1168e249f62845270455bc2baa2cb06 /llvm/lib | |
parent | 7bd2bbb9acba9b1a199252d661872182921edf73 (diff) | |
download | bcm5719-llvm-4be04b139b94e8a4f1e2033bb7693613ca26a994.tar.gz bcm5719-llvm-4be04b139b94e8a4f1e2033bb7693613ca26a994.zip |
[mips] Use function TargetInstrInfo::getRegClass.
No functionality changes.
llvm-svn: 183767
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/Mips/MipsSEInstrInfo.cpp | 12 | ||||
-rw-r--r-- | llvm/lib/Target/Mips/MipsSEInstrInfo.h | 3 |
2 files changed, 9 insertions, 6 deletions
diff --git a/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp b/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp index dc453dec321..e2a33ddb696 100644 --- a/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp +++ b/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp @@ -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); diff --git a/llvm/lib/Target/Mips/MipsSEInstrInfo.h b/llvm/lib/Target/Mips/MipsSEInstrInfo.h index 551e4e58ba8..d962ef0eb9c 100644 --- a/llvm/lib/Target/Mips/MipsSEInstrInfo.h +++ b/llvm/lib/Target/Mips/MipsSEInstrInfo.h @@ -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. /// |