forked from OSchip/llvm-project
LivePhysRegs: addLiveOuts() can skip addPristines() in ret block
Drive-by improvement: We would 1) add CSRs, 2) remove callee saved CSRs and 3) add all CSRs again for the return block. Just adding CSRs once obviously gives the same results. llvm-svn: 274955
This commit is contained in:
parent
1322b6f8bb
commit
3f80043224
|
@ -167,12 +167,13 @@ void LivePhysRegs::addLiveOuts(const MachineBasicBlock &MBB) {
|
|||
const MachineFunction &MF = *MBB.getParent();
|
||||
const MachineFrameInfo &MFI = *MF.getFrameInfo();
|
||||
if (MFI.isCalleeSavedInfoValid()) {
|
||||
addPristines(*this, MF, MFI, *TRI);
|
||||
if (MBB.isReturnBlock()) {
|
||||
// The return block has no successors whose live-ins we could merge
|
||||
// below. So instead we add the callee saved registers manually.
|
||||
for (const MCPhysReg *I = TRI->getCalleeSavedRegs(&MF); *I; ++I)
|
||||
addReg(*I);
|
||||
} else {
|
||||
addPristines(*this, MF, MFI, *TRI);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue