Add a hidden command line option to display edge bundle graphs as they are
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 5 Jan 2011 21:50:24 +0000 (21:50 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 5 Jan 2011 21:50:24 +0000 (21:50 +0000)
calculated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122912 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/EdgeBundles.cpp

index d7e73d160ebf081e4d8658eea3600a9c50f45f39..aed8bc947991e9a923ba496f6e82714762d3020e 100644 (file)
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/Passes.h"
+#include "llvm/Support/CommandLine.h"
 #include "llvm/Support/GraphWriter.h"
 
 using namespace llvm;
 
+static cl::opt<bool>
+ViewEdgeBundles("view-edge-bundles", cl::Hidden,
+                cl::desc("Pop up a window to show edge bundle graphs"));
+
 char EdgeBundles::ID = 0;
 
 INITIALIZE_PASS(EdgeBundles, "edge-bundles", "Bundle Machine CFG Edges",
@@ -46,6 +51,8 @@ bool EdgeBundles::runOnMachineFunction(MachineFunction &mf) {
       EC.join(OutE, 2 * (*SI)->getNumber());
   }
   EC.compress();
+  if (ViewEdgeBundles)
+    view();
   return false;
 }