aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2008-10-27 21:56:29 +0000
committerDavid Greene <greened@obbligato.org>2008-10-27 21:56:29 +0000
commit8ad4c00c00233acb8a3395098e2b575cc34de46b (patch)
tree5df349b3bbb9c33edd4a4b5a52f2ca8f74d8fc5f /include
parent9a40d3361ac29fd3c9e0b4a0aa5c7845cc46ec25 (diff)
downloadexternal_llvm-8ad4c00c00233acb8a3395098e2b575cc34de46b.zip
external_llvm-8ad4c00c00233acb8a3395098e2b575cc34de46b.tar.gz
external_llvm-8ad4c00c00233acb8a3395098e2b575cc34de46b.tar.bz2
Have TableGen emit setSubgraphColor calls under control of a -gen-debug
flag. Then in a debugger developers can set breakpoints at these calls to see waht is about to be selected and what the resulting subgraph looks like. This really helps when debugging instruction selection. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58278 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/DAGISelHeader.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/DAGISelHeader.h b/include/llvm/CodeGen/DAGISelHeader.h
index 3542ebc..e50ee7c 100644
--- a/include/llvm/CodeGen/DAGISelHeader.h
+++ b/include/llvm/CodeGen/DAGISelHeader.h
@@ -153,7 +153,7 @@ void ReplaceUses(SDNode *F, SDNode *T) DISABLE_INLINE {
/// SelectRoot - Top level entry to DAG instruction selector.
/// Selects instructions starting at the root of the current DAG.
-void SelectRoot() {
+void SelectRoot(SelectionDAG &DAG) {
SelectRootInit();
unsigned NumBytes = (DAGSize + 7) / 8;
ISelQueued = new unsigned char[NumBytes];
@@ -176,14 +176,18 @@ void SelectRoot() {
// Skip already selected nodes.
if (isSelected(Node->getNodeId()))
continue;
+ DAG.setSubgraphColor(Node, "red");
SDNode *ResNode = Select(SDValue(Node, 0));
// If node should not be replaced,
// continue with the next one.
if (ResNode == Node)
continue;
// Replace node.
- if (ResNode)
+ if (ResNode) {
+ DAG.setSubgraphColor(ResNode, "yellow");
+ DAG.setSubgraphColor(ResNode, "black");
ReplaceUses(Node, ResNode);
+ }
// If after the replacement this node is not used any more,
// remove this dead node.
if (Node->use_empty()) { // Don't delete EntryToken, etc.
@@ -191,6 +195,7 @@ void SelectRoot() {
CurDAG->RemoveDeadNode(Node, &ISQU);
UpdateQueue(ISQU);
}
+ //DAG.setSubgraphColor(Node, "black");
}
delete[] ISelQueued;