mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-04 18:24:38 +00:00
Move common code into an MRI function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147071 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -224,17 +224,9 @@ void PEI::calculateCalleeSavedRegisters(MachineFunction &Fn) {
|
||||
std::vector<CalleeSavedInfo> CSI;
|
||||
for (unsigned i = 0; CSRegs[i]; ++i) {
|
||||
unsigned Reg = CSRegs[i];
|
||||
if (Fn.getRegInfo().isPhysRegUsed(Reg)) {
|
||||
if (Fn.getRegInfo().isPhysRegOrOverlapUsed(Reg)) {
|
||||
// If the reg is modified, save it!
|
||||
CSI.push_back(CalleeSavedInfo(Reg));
|
||||
} else {
|
||||
for (const unsigned *AliasSet = RegInfo->getAliasSet(Reg);
|
||||
*AliasSet; ++AliasSet) { // Check alias registers too.
|
||||
if (Fn.getRegInfo().isPhysRegUsed(*AliasSet)) {
|
||||
CSI.push_back(CalleeSavedInfo(Reg));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user