[AArch64, X86] Additional debug information for MacroFusion

In order to make it easier to parse information about the performance of
MacroFusion, this patch adds the function and the instruction names to the
debug output of this pass.

llvm-svn: 297504
diff --git a/llvm/lib/Target/X86/X86MacroFusion.cpp b/llvm/lib/Target/X86/X86MacroFusion.cpp
index e1253d3..89efd248 100644
--- a/llvm/lib/Target/X86/X86MacroFusion.cpp
+++ b/llvm/lib/Target/X86/X86MacroFusion.cpp
@@ -214,6 +214,7 @@
 
 void X86MacroFusion::apply(ScheduleDAGInstrs *DAGInstrs) {
   ScheduleDAGMI *DAG = static_cast<ScheduleDAGMI*>(DAGInstrs);
+  const TargetInstrInfo &TII = *DAG->TII;
   const X86Subtarget &ST = DAG->MF.getSubtarget<X86Subtarget>();
 
   // For now, assume targets can only fuse with the branch.
@@ -249,9 +250,12 @@
         SuccDep.setLatency(0);
 
     ++NumFused;
-    DEBUG(dbgs() << "Macro fuse ";
+    DEBUG(dbgs() << DAG->MF.getName() << "(): Macro fuse ";
           SU.print(dbgs(), DAG);
-          dbgs() << " - ExitSU" << '\n');
+          dbgs() << " - ExitSU" << " / " <<
+                    TII.getName(Pred.getOpcode()) << " - " <<
+                    TII.getName(Branch->getOpcode()) << '\n';
+);
 
     break;
   }