[llvm-commits] [llvm] r96812 - /llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h
Chris Lattner
sabre at nondot.org
Mon Feb 22 14:15:39 PST 2010
Author: lattner
Date: Mon Feb 22 16:15:39 2010
New Revision: 96812
URL: http://llvm.org/viewvc/llvm-project?rev=96812&view=rev
Log:
add some debug hooks for tracking the behavior of the isel.
Modified:
llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h
Modified: llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h?rev=96812&r1=96811&r2=96812&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h (original)
+++ llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h Mon Feb 22 16:15:39 2010
@@ -336,6 +336,10 @@
// 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 @@
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 @@
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 @@
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);
More information about the llvm-commits
mailing list