Reduce usage of MRegisterInfo::getRegClass

llvm-svn: 17238
This commit is contained in:
Chris Lattner 2004-10-26 05:29:18 +00:00
parent ae98298003
commit 6e775d56cf

View File

@ -658,15 +658,16 @@ void LiveIntervals::joinIntervals() {
/// classes. The registers may be either phys or virt regs.
bool LiveIntervals::differingRegisterClasses(unsigned RegA,
unsigned RegB) const {
const TargetRegisterClass *RegClass;
// Get the register classes for the first reg.
if (MRegisterInfo::isVirtualRegister(RegA))
RegClass = mf_->getSSARegMap()->getRegClass(RegA);
else
RegClass = mri_->getRegClass(RegA);
if (MRegisterInfo::isPhysicalRegister(RegA)) {
assert(MRegisterInfo::isVirtualRegister(RegB) &&
"Shouldn't consider two physregs!");
return !mf_->getSSARegMap()->getRegClass(RegB)->contains(RegA);
}
// Compare against the regclass for the second reg.
const TargetRegisterClass *RegClass = mf_->getSSARegMap()->getRegClass(RegA);
if (MRegisterInfo::isVirtualRegister(RegB))
return RegClass != mf_->getSSARegMap()->getRegClass(RegB);
else