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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 13 02:01:55 PST 2018


fhahn added a comment.

Thanks, and sorry for taking so long to come back to this. I think it looks good, there is just the missing newline issue. After that's resolved I would be happy to sign off on the machine combiner changes, but I would prefer if we move the lib/CodeGen/MachineInstr.cpp to a separate patch.



================
Comment at: lib/CodeGen/MachineCombiner.cpp:492
+      DEBUG(if (dump_intrs) {
+        dbgs() << "\tFor the Pattern (" << (int)P << ") these instructions could be removed\n";
+        for (auto const *InstrPtr : DelInstrs) {
----------------
I do not think we reference the pattern ID anywhere else, so I am not sure how it would be helpful here. Also, should Pattern be lowercase?


================
Comment at: lib/CodeGen/MachineCombiner.cpp:495
+          dbgs() << "\t\t" << STI->getSchedInfoStr(*InstrPtr) << ": ";
+          InstrPtr->print(dbgs(), false, false, TII);
+        }
----------------
I think you need `\n` after the print calls in your patch . I get the following output (see the machine instrs all on the same line):

```
	For the Pattern (21) these instructions could be removed
		 sched: [5:0.50]: %8:fpr64 = FMULDrr %7, %7		 sched: [5:0.50]: %9:fpr64 = FADDDrr %0, killed %8	These instructions could replace the removed ones
		 sched: [9:0.50]: %9 = UNKNOWN %7, %7, %0Computing MinInstr trace through %bb.1
```


https://reviews.llvm.org/D41278





More information about the llvm-commits mailing list