OSDN Git Service

The final step to close D41278 [MachineCombiner] Improve debug output (NFC).
authorAndrew V. Tischenko <andrew.v.tischenko@gmail.com>
Mon, 26 Feb 2018 09:43:21 +0000 (09:43 +0000)
committerAndrew V. Tischenko <andrew.v.tischenko@gmail.com>
Mon, 26 Feb 2018 09:43:21 +0000 (09:43 +0000)
Differential Revision: https://reviews.llvm.org/D41278

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326074 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineCombiner.cpp
lib/CodeGen/MachineInstr.cpp

index efdffe8..efb463f 100644 (file)
@@ -559,14 +559,12 @@ bool MachineCombiner::combineInstructions(MachineBasicBlock *MBB) {
         dbgs() << "\tFor the Pattern (" << (int)P << ") these instructions could be removed\n";
         for (auto const *InstrPtr : DelInstrs) {
           dbgs() << "\t\t" << STI->getSchedInfoStr(*InstrPtr) << ": ";
-          InstrPtr->print(dbgs(), false, false, TII);
-          dbgs() << "\n";
+          InstrPtr->print(dbgs(), false, false, false, TII);
         }
         dbgs() << "\tThese instructions could replace the removed ones\n";
         for (auto const *InstrPtr : InsInstrs) {
           dbgs() << "\t\t" << STI->getSchedInfoStr(*InstrPtr) << ": ";
-          InstrPtr->print(dbgs(), false, false, TII);
-          dbgs() << "\n";
+          InstrPtr->print(dbgs(), false, false, false, TII);
         }
       });
 
index 98993b2..7d04e6b 100644 (file)
@@ -1235,6 +1235,8 @@ void MachineInstr::print(raw_ostream &OS, bool IsStandalone, bool SkipOpers,
   if (const MachineFunction *MF = getMFIfAvailable(*this)) {
     F = &MF->getFunction();
     M = F->getParent();
+    if (!TII)
+      TII = MF->getSubtarget().getInstrInfo();
   }
 
   ModuleSlotTracker MST(M);