diff options
author | Florian Hahn <flo@fhahn.com> | 2019-04-10 09:03:03 +0000 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2019-04-10 09:03:03 +0000 |
commit | 83443c9a9ec76e55a052854bfacdbb40d2eb6a72 (patch) | |
tree | b6545221124cead21fd16dfc1a81fb908865a8e3 /llvm | |
parent | fab4bdf4b93eb7e4a5b85b9131b70debc1cd7663 (diff) | |
download | bcm5719-llvm-83443c9a9ec76e55a052854bfacdbb40d2eb6a72.tar.gz bcm5719-llvm-83443c9a9ec76e55a052854bfacdbb40d2eb6a72.zip |
[ScheduleDAG] Add statistics for maintaining the topological order.
This is helpful to measure the impact of D60125 on maintaining
topological orders.
Reviewers: MatzeB, atrick, efriedma, niravd
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D60187
llvm-svn: 358058
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/CodeGen/ScheduleDAG.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/ScheduleDAG.cpp b/llvm/lib/CodeGen/ScheduleDAG.cpp index 8ebe8fa6bd6..5294c5b1c2c 100644 --- a/llvm/lib/CodeGen/ScheduleDAG.cpp +++ b/llvm/lib/CodeGen/ScheduleDAG.cpp @@ -14,6 +14,7 @@ #include "llvm/CodeGen/ScheduleDAG.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/Statistic.h" #include "llvm/ADT/iterator_range.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/ScheduleHazardRecognizer.h" @@ -37,6 +38,10 @@ using namespace llvm; #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<bool> StressSchedOpt( "stress-sched", cl::Hidden, cl::init(false), @@ -497,6 +502,7 @@ void ScheduleDAGTopologicalSort::InitDAGTopologicalSorting() { } Visited.resize(DAGSize); + NumTopoInits++; #ifndef NDEBUG // Check correctness of the ordering @@ -523,6 +529,8 @@ void ScheduleDAGTopologicalSort::AddPred(SUnit *Y, SUnit *X) { // Recompute topological indexes. Shift(Visited, LowerBound, UpperBound); } + + NumNewPredsAdded++; } void ScheduleDAGTopologicalSort::RemovePred(SUnit *M, SUnit *N) { |