[llvm-mca] Add flag -resource-pressure to enable/disable printing of the resource...
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Fri, 23 Mar 2018 11:33:09 +0000 (11:33 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Fri, 23 Mar 2018 11:33:09 +0000 (11:33 +0000)
By default, the tool always enables the resource pressure view.
This flag lets user specify whether they want to add that view or not.

llvm-svn: 328305

llvm/tools/llvm-mca/llvm-mca.cpp

index e9248f154429f578b2b970777297061f226ee532..0ae9c8849bbba0258f1324925a316c6afd4a1052 100644 (file)
@@ -89,6 +89,11 @@ static cl::opt<unsigned>
                               "be used for register mappings"),
                      cl::init(0));
 
+static cl::opt<bool>
+    PrintResourcePressureView("resource-pressure",
+                              cl::desc("Print the resource pressure view"),
+                              cl::init(true));
+
 static cl::opt<bool> PrintTimelineView("timeline",
                                        cl::desc("Print the timeline view"),
                                        cl::init(false));
@@ -329,7 +334,8 @@ int main(int argc, char **argv) {
   if (PrintModeVerbose)
     Printer->addView(llvm::make_unique<mca::BackendStatistics>(*STI));
 
-  Printer->addView(llvm::make_unique<mca::ResourcePressureView>(*STI, *IP, *S));
+  if (PrintResourcePressureView)
+    Printer->addView(llvm::make_unique<mca::ResourcePressureView>(*STI, *IP, *S));
 
   if (PrintTimelineView) {
     Printer->addView(llvm::make_unique<mca::TimelineView>(