summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-22 22:15:39 +0000
committerChris Lattner <sabre@nondot.org>2010-02-22 22:15:39 +0000
commit3df577b71beb6da2d9ac46233871eb081bacbf6a (patch)
tree22fc71e795da3e9cb725a6012640b33e98308884 /include
parent54de8c1b391d060efc5140f31c04979500fcfb58 (diff)
downloadllvm-3df577b71beb6da2d9ac46233871eb081bacbf6a.tar.gz
llvm-3df577b71beb6da2d9ac46233871eb081bacbf6a.tar.bz2
llvm-3df577b71beb6da2d9ac46233871eb081bacbf6a.tar.xz
add some debug hooks for tracking the behavior of the isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96812 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/DAGISelHeader.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/DAGISelHeader.h b/include/llvm/CodeGen/DAGISelHeader.h
index d800281bd5..63d15cda6c 100644
--- a/include/llvm/CodeGen/DAGISelHeader.h
+++ b/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);