[PATCH] D41278: [MachineCombiner] Improve debug output (NFC)

Andrew V. Tischenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 26 01:43:49 PST 2018


avt77 added inline comments.


================
Comment at: lib/CodeGen/MachineCombiner.cpp:478
 
+    DEBUG(dbgs() << " Possible instr(s) to replace\n");
+    DEBUG(dbgs() << "\t" << STI.getSchedInfoStr(MI) << ": ";
----------------
fhahn wrote:
> avt77 wrote:
> > Gerolf wrote:
> > > Duplicate info to what is displayed in the loops below?
> > No, here we have only one possible instr to remove (the message should be changed). Below we could have a set of instrs to remove.
> I think " Possible instr to replace" is not quite accurate. At this point we found > 0 patterns that could replace a pattern with `MI` as root.
OK, "Possible patterns to replace the instr:\n" ? And in this case we need loop here, right?


================
Comment at: lib/CodeGen/MachineCombiner.cpp:478
+    DEBUG(dbgs() << " Possible instr to replace\n");
+    DEBUG(dbgs() << "\t" << STI->getSchedInfoStr(MI) << ": ";
+          MI.print(dbgs(), false, false, TII););
----------------
fhahn wrote:
> What additional information does the SchedInfoStr add here? 
We are able to compare lattency:throughput of original instr with replaced instrs.


================
Comment at: lib/CodeGen/MachineInstr.cpp:1216
+      if (!TII)
+        TII = MF->getSubtarget().getInstrInfo();
+    }
----------------
fhahn wrote:
> The changes to `MachineInstr.cpp` seem unrelated to improving the debug output for the MachineCombiner? 
We call MachineInstr::print from MachineCombiner and here we try to improve the output if we don't have valid TII pointer (I saw such situations if the given istr was not included in any MachineFunction yet).


https://reviews.llvm.org/D41278





More information about the llvm-commits mailing list