[llvm] r258569 - Fix LivePhysRegs::addLiveOuts

Weiming Zhao via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 22 14:21:34 PST 2016


Author: weimingz
Date: Fri Jan 22 16:21:34 2016
New Revision: 258569

URL: http://llvm.org/viewvc/llvm-project?rev=258569&view=rev
Log:
 Fix LivePhysRegs::addLiveOuts

Summary:
The testing for returnBB was flipped which may cause ARM ld/st opt pass uses callee saved regs in returnBB when shrink-wrap is used.


Reviewers: t.p.northover, apazos, MatzeB

Subscribers: mcrosier, zzheng, aemerson, llvm-commits, rengolin

Differential Revision: http://reviews.llvm.org/D16434

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=258569&r1=258568&r2=258569&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LivePhysRegs.cpp (original)
+++ llvm/trunk/lib/CodeGen/LivePhysRegs.cpp Fri Jan 22 16:21:34 2016
@@ -151,7 +151,7 @@ void LivePhysRegs::addLiveOuts(const Mac
   if (AddPristinesAndCSRs) {
     const MachineFunction &MF = *MBB->getParent();
     addPristines(*this, MF, *TRI);
-    if (!MBB->isReturnBlock()) {
+    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)




More information about the llvm-commits mailing list