Keep track how many commutes are performed by the scheduler.
authorEvan Cheng <evan.cheng@apple.com>
Thu, 28 Feb 2008 07:40:24 +0000 (07:40 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 28 Feb 2008 07:40:24 +0000 (07:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47710 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/ScheduleDAG.cpp

index da79a991c243421bf0e59d0d4c3ba6cf7b7aab0e..c87fb60593ff3943d1e27d1bef3311428354e570 100644 (file)
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/TargetInstrInfo.h"
 #include "llvm/Target/TargetLowering.h"
+#include "llvm/ADT/Statistic.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/MathExtras.h"
 using namespace llvm;
 
+STATISTIC(NumCommutes,   "Number of instructions commuted");
+
 ScheduleDAG::ScheduleDAG(SelectionDAG &dag, MachineBasicBlock *bb,
                          const TargetMachine &tm)
   : DAG(dag), BB(bb), TM(tm), RegInfo(BB->getParent()->getRegInfo()) {
@@ -733,6 +736,7 @@ void ScheduleDAG::EmitNode(SDNode *Node, unsigned InstanceNo,
           delete MI;
           MI = NewMI;
         }
+        ++NumCommutes;
       }
     }