mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Implicitly defined registers can clobber callee saved registers too!
This fixes the return-address-not-being-saved problem in the Alpha backend. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19741 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2202bfa5a3
commit
5037a15910
@ -96,6 +96,7 @@ FunctionPass *llvm::createPrologEpilogCodeInserter() { return new PEI(); }
|
||||
void PEI::calculateCallerSavedRegisters(MachineFunction &Fn) {
|
||||
const MRegisterInfo *RegInfo = Fn.getTarget().getRegisterInfo();
|
||||
const TargetFrameInfo *TFI = Fn.getTarget().getFrameInfo();
|
||||
const TargetInstrInfo &TII = *Fn.getTarget().getInstrInfo();
|
||||
|
||||
// Get the callee saved register list...
|
||||
const unsigned *CSRegs = RegInfo->getCalleeSaveRegs();
|
||||
@ -133,6 +134,11 @@ void PEI::calculateCallerSavedRegisters(MachineFunction &Fn) {
|
||||
"Register allocation must be performed!");
|
||||
ModifiedRegs[MO.getReg()] = true; // Register is modified
|
||||
}
|
||||
|
||||
// Mark any implicitly defined registers as being modified.
|
||||
for (const unsigned *ImpDefs = TII.getImplicitDefs(I->getOpcode());
|
||||
*ImpDefs; ++ImpDefs)
|
||||
ModifiedRegs[*ImpDefs] = true;
|
||||
}
|
||||
++I;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user