forked from OSchip/llvm-project
Fix the last virtual register enumerations.
llvm-svn: 123102
This commit is contained in:
parent
cf4d5ced0f
commit
4a7b48d5f4
|
@ -172,12 +172,13 @@ void PPCDAGToDAGISel::InsertVRSaveCode(MachineFunction &Fn) {
|
|||
// In this case, there will be virtual registers of vector type created
|
||||
// by the scheduler. Detect them now.
|
||||
bool HasVectorVReg = false;
|
||||
for (unsigned i = TargetRegisterInfo::FirstVirtualRegister,
|
||||
e = RegInfo->getLastVirtReg()+1; i != e; ++i)
|
||||
if (RegInfo->getRegClass(i) == &PPC::VRRCRegClass) {
|
||||
for (unsigned i = 0, e = RegInfo->getNumVirtRegs(); i != e; ++i) {
|
||||
unsigned Reg = TargetRegisterInfo::index2VirtReg(i);
|
||||
if (RegInfo->getRegClass(Reg) == &PPC::VRRCRegClass) {
|
||||
HasVectorVReg = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!HasVectorVReg) return; // nothing to do.
|
||||
|
||||
// If we have a vector register, we want to emit code into the entry and exit
|
||||
|
|
|
@ -814,13 +814,13 @@ namespace {
|
|||
// Be over-conservative: scan over all vreg defs and find whether vector
|
||||
// registers are used. If yes, there is a possibility that vector register
|
||||
// will be spilled and thus require dynamic stack realignment.
|
||||
for (unsigned RegNum = TargetRegisterInfo::FirstVirtualRegister;
|
||||
RegNum < RI.getLastVirtReg(); ++RegNum)
|
||||
if (RI.getRegClass(RegNum)->getAlignment() > StackAlignment) {
|
||||
for (unsigned i = 0, e = RI.getNumVirtRegs(); i != e; ++i) {
|
||||
unsigned Reg = TargetRegisterInfo::index2VirtReg(i);
|
||||
if (RI.getRegClass(Reg)->getAlignment() > StackAlignment) {
|
||||
FuncInfo->setReserveFP(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
// Nothing to do
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue