diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2009-10-21 19:18:28 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2009-10-21 19:18:28 +0000 |
commit | a91f4c561e87c61beab3b70c8655992faad735a4 (patch) | |
tree | 9374c1372eb2653423216bcc4d6755c2a0b6d2df /lib/Target/MSP430/MSP430ISelDAGToDAG.cpp | |
parent | 83fceb948165adb50c450ff28d51d0a99615b854 (diff) | |
download | external_llvm-a91f4c561e87c61beab3b70c8655992faad735a4.zip external_llvm-a91f4c561e87c61beab3b70c8655992faad735a4.tar.gz external_llvm-a91f4c561e87c61beab3b70c8655992faad735a4.tar.bz2 |
Add DAG printing for RMW stuff debugging
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84776 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/MSP430/MSP430ISelDAGToDAG.cpp')
-rw-r--r-- | lib/Target/MSP430/MSP430ISelDAGToDAG.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp b/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp index fb841ba..550c468 100644 --- a/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp +++ b/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()); |