mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Fix the last virtual register enumerations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123102 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c7d67f90d3
commit
b258135301
@ -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
Block a user