diff --git a/llvm/lib/CodeGen/ScheduleDAG.cpp b/llvm/lib/CodeGen/ScheduleDAG.cpp --- a/llvm/lib/CodeGen/ScheduleDAG.cpp +++ b/llvm/lib/CodeGen/ScheduleDAG.cpp @@ -26,6 +26,7 @@ #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/ADT/Statistic.h" #include #include #include @@ -37,6 +38,9 @@ #define DEBUG_TYPE "pre-RA-sched" +STATISTIC(NumNewPredsAdded, "Number of times a single predecessor was added"); +STATISTIC(NumTopoInits, "Number of times the topological order has been recomputed"); + #ifndef NDEBUG static cl::opt StressSchedOpt( "stress-sched", cl::Hidden, cl::init(false), @@ -497,6 +501,7 @@ } Visited.resize(DAGSize); + NumTopoInits++; #ifndef NDEBUG // Check correctness of the ordering @@ -523,6 +528,8 @@ // Recompute topological indexes. Shift(Visited, LowerBound, UpperBound); } + + NumNewPredsAdded++; } void ScheduleDAGTopologicalSort::RemovePred(SUnit *M, SUnit *N) {