summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2009-10-21 19:18:28 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2009-10-21 19:18:28 +0000
commit9e92857b3880b448b3ea9508ded31e97f4a11126 (patch)
treefa8513ac0c65fe7f3bd0329763109b49d4c19004 /llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp
parentccfa3e31f7983871e6da0795ad0809ce79bf299f (diff)
downloadbcm5719-llvm-9e92857b3880b448b3ea9508ded31e97f4a11126.tar.gz
bcm5719-llvm-9e92857b3880b448b3ea9508ded31e97f4a11126.zip
Add DAG printing for RMW stuff debugging
llvm-svn: 84776
Diffstat (limited to 'llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp')
-rw-r--r--llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp b/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp
index fb841ba006c..550c46897c4 100644
--- a/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp
+++ b/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp
@@ -26,6 +26,7 @@
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/SelectionDAGISel.h"
#include "llvm/Target/TargetLowering.h"
+#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
@@ -34,6 +35,14 @@
using namespace llvm;
+#ifndef NDEBUG
+static cl::opt<bool>
+ViewRMWDAGs("view-msp430-rmw-dags", cl::Hidden,
+ cl::desc("Pop up a window to show isel dags after RMW preprocess"));
+#else
+static const bool ViewRMWDAGs = false;
+#endif
+
STATISTIC(NumLoadMoved, "Number of loads moved below TokenFactor");
/// MSP430DAGToDAGISel - MSP430 specific code to select MSP430 machine
@@ -288,8 +297,15 @@ void MSP430DAGToDAGISel::PreprocessForRMW() {
/// InstructionSelect - This callback is invoked by
/// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
void MSP430DAGToDAGISel::InstructionSelect() {
+ std::string BlockName;
+ if (ViewRMWDAGs)
+ BlockName = MF->getFunction()->getNameStr() + ":" +
+ BB->getBasicBlock()->getNameStr();
+
PreprocessForRMW();
+ if (ViewRMWDAGs) CurDAG->viewGraph("RMW preprocessed:" + BlockName);
+
DEBUG(errs() << "Selection DAG after RMW preprocessing:\n");
DEBUG(CurDAG->dump());
OpenPOWER on IntegriCloud