diff options
author | Chris Lattner <sabre@nondot.org> | 2010-02-22 22:15:39 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-02-22 22:15:39 +0000 |
commit | 065882a2ca397f77fb2ce0f68fb0222473214217 (patch) | |
tree | 32034833ef8455bf1cccb9e56019cac9ca81bda4 /llvm | |
parent | 3ac438b920202cf1116c986feea830b343e31cc9 (diff) | |
download | bcm5719-llvm-065882a2ca397f77fb2ce0f68fb0222473214217.tar.gz bcm5719-llvm-065882a2ca397f77fb2ce0f68fb0222473214217.zip |
add some debug hooks for tracking the behavior of the isel.
llvm-svn: 96812
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/CodeGen/DAGISelHeader.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/include/llvm/CodeGen/DAGISelHeader.h b/llvm/include/llvm/CodeGen/DAGISelHeader.h index d800281bd59..63d15cda6c8 100644 --- a/llvm/include/llvm/CodeGen/DAGISelHeader.h +++ b/llvm/include/llvm/CodeGen/DAGISelHeader.h @@ -336,6 +336,10 @@ SDNode *SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable, // update the chain results when the pattern is complete. SmallVector<SDNode*, 3> ChainNodesMatched; + DEBUG(errs() << "ISEL: Starting pattern match on root node: "; + NodeToMatch->dump(CurDAG); + errs() << '\n'); + // Interpreter starts at opcode #0. unsigned MatcherIndex = 0; while (1) { @@ -722,6 +726,8 @@ SDNode *SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable, std::copy(MatchedMemRefs.begin(), MatchedMemRefs.end(), MemRefs); Res->setMemRefs(MemRefs, MemRefs + MatchedMemRefs.size()); } + + DEBUG(errs() << " Created node: "; Res->dump(CurDAG); errs() << "\n"); continue; } @@ -777,6 +783,9 @@ SDNode *SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable, assert(NodeToMatch->use_empty() && "Didn't replace all uses of the node?"); + + DEBUG(errs() << "ISEL: Match complete!\n"); + // FIXME: We just return here, which interacts correctly with SelectRoot // above. We should fix this to not return an SDNode* anymore. return 0; @@ -794,6 +803,9 @@ SDNode *SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable, RecordedNodes.resize(LastScope.NumRecordedNodes); NodeStack.resize(LastScope.NodeStackSize); N = NodeStack.back(); + + DEBUG(errs() << " Match failed at index " << MatcherIndex + << " continuing at " << LastScope.FailIndex << "\n"); if (LastScope.NumMatchedMemRefs != MatchedMemRefs.size()) MatchedMemRefs.resize(LastScope.NumMatchedMemRefs); |