[llvm] r214986 - Cleanup collectChangingRegs

Adrian Prantl aprantl at apple.com
Wed Aug 6 11:41:20 PDT 2014


Author: adrian
Date: Wed Aug  6 13:41:19 2014
New Revision: 214986

URL: http://llvm.org/viewvc/llvm-project?rev=214986&view=rev
Log:
Cleanup collectChangingRegs

The handling of the epilogue is best expressed as an early exit and
there is no reason to look for register defs in DbgValue MIs.

Patch by Frederic Riss!

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp?rev=214986&r1=214985&r2=214986&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp Wed Aug  6 13:41:19 2014
@@ -152,10 +152,11 @@ static void collectChangingRegs(const Ma
                                 std::set<unsigned> &Regs) {
   for (const auto &MBB : *MF) {
     auto FirstEpilogueInst = getFirstEpilogueInst(MBB);
-    bool IsInEpilogue = false;
+
     for (const auto &MI : MBB) {
-      IsInEpilogue |= &MI == FirstEpilogueInst;
-      if (!MI.getFlag(MachineInstr::FrameSetup) && !IsInEpilogue)
+      if (&MI == FirstEpilogueInst)
+        break;
+      if (!MI.getFlag(MachineInstr::FrameSetup))
         collectClobberedRegisters(MI, TRI, Regs);
     }
   }





More information about the llvm-commits mailing list