summaryrefslogtreecommitdiff
path: root/lib/CodeGen/EdgeBundles.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-01-05 21:50:24 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-01-05 21:50:24 +0000
commit6b705d482511e432a543d04f6f5e27f5881b6441 (patch)
treed87d1eab2585f6f1eb75feb6b096366964c192a9 /lib/CodeGen/EdgeBundles.cpp
parent7008f1e9ab3e455955bac764282b62d51b5ae523 (diff)
downloadllvm-6b705d482511e432a543d04f6f5e27f5881b6441.tar.gz
llvm-6b705d482511e432a543d04f6f5e27f5881b6441.tar.bz2
llvm-6b705d482511e432a543d04f6f5e27f5881b6441.tar.xz
Add a hidden command line option to display edge bundle graphs as they are
calculated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122912 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/EdgeBundles.cpp')
-rw-r--r--lib/CodeGen/EdgeBundles.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/CodeGen/EdgeBundles.cpp b/lib/CodeGen/EdgeBundles.cpp
index d7e73d160e..aed8bc9479 100644
--- a/lib/CodeGen/EdgeBundles.cpp
+++ b/lib/CodeGen/EdgeBundles.cpp
@@ -15,10 +15,15 @@
#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;
}