[llvm] r274955 - LivePhysRegs: addLiveOuts() can skip addPristines() in ret block
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 8 18:31:36 PDT 2016
Author: matze
Date: Fri Jul 8 20:31:36 2016
New Revision: 274955
URL: http://llvm.org/viewvc/llvm-project?rev=274955&view=rev
Log:
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.
Modified:
llvm/trunk/lib/CodeGen/LivePhysRegs.cpp
Modified: llvm/trunk/lib/CodeGen/LivePhysRegs.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LivePhysRegs.cpp?rev=274955&r1=274954&r2=274955&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LivePhysRegs.cpp (original)
+++ llvm/trunk/lib/CodeGen/LivePhysRegs.cpp Fri Jul 8 20:31:36 2016
@@ -167,12 +167,13 @@ void LivePhysRegs::addLiveOuts(const Mac
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);
}
}
More information about the llvm-commits
mailing list