diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-09-14 23:05:33 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-09-14 23:05:33 +0000 |
commit | 39c94e105fcfdb59555e8c3b5e6798a81bc3ea6b (patch) | |
tree | 0b716b24d11f8b65cbe8e2aa0da7212117a7d968 /lib/CodeGen/RegAlloc/RegClass.cpp | |
parent | 521758fb79e439b33793f0adc2f455b487034bbd (diff) |
Break RA_DEBUG option into several levels to get better control over
debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3724 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAlloc/RegClass.cpp')
-rw-r--r-- | lib/CodeGen/RegAlloc/RegClass.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/CodeGen/RegAlloc/RegClass.cpp b/lib/CodeGen/RegAlloc/RegClass.cpp index 5998f1fd66..b92b70997b 100644 --- a/lib/CodeGen/RegAlloc/RegClass.cpp +++ b/lib/CodeGen/RegAlloc/RegClass.cpp @@ -1,3 +1,9 @@ +//===-- RegClass.cpp -----------------------------------------------------===// +// +// class RegClass for coloring-based register allocation for LLVM. +// +//===----------------------------------------------------------------------===// + #include "llvm/CodeGen/RegClass.h" #include "llvm/CodeGen/RegAllocCommon.h" using std::cerr; @@ -11,7 +17,7 @@ RegClass::RegClass(const Function *M, const ReservedColorListType *RCL) : Meth(M), MRC(Mrc), RegClassID( Mrc->getRegClassID() ), IG(this), IGNodeStack(), ReservedColorList(RCL) { - if( DEBUG_RA) + if( DEBUG_RA >= RA_DEBUG_Interference) cerr << "Created Reg Class: " << RegClassID << "\n"; IsColorUsedArr.resize(Mrc->getNumOfAllRegs()); @@ -24,7 +30,8 @@ RegClass::RegClass(const Function *M, //---------------------------------------------------------------------------- void RegClass::colorAllRegs() { - if(DEBUG_RA) cerr << "Coloring IG of reg class " << RegClassID << " ...\n"; + if(DEBUG_RA >= RA_DEBUG_Coloring) + cerr << "Coloring IG of reg class " << RegClassID << " ...\n"; // pre-color IGNodes pushAllIGNodes(); // push all IG Nodes @@ -57,7 +64,7 @@ void RegClass::pushAllIGNodes() // push non-constrained IGNodes bool PushedAll = pushUnconstrainedIGNodes(); - if( DEBUG_RA) { + if( DEBUG_RA >= RA_DEBUG_Coloring) { cerr << " Puhsed all-unconstrained IGNodes. "; if( PushedAll ) cerr << " No constrained nodes left."; cerr << "\n"; @@ -88,7 +95,7 @@ void RegClass::pushAllIGNodes() // NeedMoreSpills = !pushUnconstrainedIGNodes(); - if (DEBUG_RA) + if (DEBUG_RA >= RA_DEBUG_Coloring) cerr << "\nConstrained IG Node found !@!" << IGNodeSpill->getIndex(); } while(NeedMoreSpills); // repeat until we have pushed all @@ -129,7 +136,7 @@ bool RegClass::pushUnconstrainedIGNodes() IGNodeStack.push( IGNode ); // push IGNode on to the stack IGNode->pushOnStack(); // set OnStack and dec deg of neighs - if (DEBUG_RA > 1) { + if (DEBUG_RA >= RA_DEBUG_Coloring) { cerr << " pushed un-constrained IGNode " << IGNode->getIndex() ; cerr << " on to stack\n"; } @@ -230,7 +237,7 @@ void RegClass::colorIGNode(IGNode *const Node) MRC->colorIGNode(Node, IsColorUsedArr); } else { - if( DEBUG_RA ) { + if( DEBUG_RA >= RA_DEBUG_Coloring) { cerr << " Node " << Node->getIndex(); cerr << " already colored with color " << Node->getColor() << "\n"; } @@ -238,7 +245,7 @@ void RegClass::colorIGNode(IGNode *const Node) if( !Node->hasColor() ) { - if( DEBUG_RA ) { + if( DEBUG_RA >= RA_DEBUG_Coloring) { cerr << " Node " << Node->getIndex(); cerr << " - could not find a color (needs spilling)\n"; } |