diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-08-01 22:09:43 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-08-01 22:09:43 +0000 |
commit | 356665a36c0279451d52527ba55af381e457d6f0 (patch) | |
tree | 42de702d42b2e5fdb746f87e75742ab6c10529f3 /llvm/lib/CodeGen | |
parent | d9dbecd74d7849a97bbec9bf7d484b498402020a (diff) | |
download | bcm5719-llvm-356665a36c0279451d52527ba55af381e457d6f0.tar.gz bcm5719-llvm-356665a36c0279451d52527ba55af381e457d6f0.zip |
[SDAG] MorphNodeTo recursively deletes dead operands of the old
fromulation of the node, which isn't really the desired behavior from
within the combiner or legalizer, but is necessary within ISel. I've
added a hopefully helpful comment and fixed the only two places where
this took place.
Yet another step toward the combiner and legalizer not needing to use
update listeners with virtual calls to manage the worklists behind
legalization and combining.
llvm-svn: 214574
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index b9a0f44990f..a69a11941ca 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -5467,6 +5467,10 @@ SDNode *SelectionDAG::UpdadeSDLocOnMergedSDNode(SDNode *N, SDLoc OLoc) { /// node, and because it doesn't require CSE recalculation for any of /// the node's users. /// +/// However, note that MorphNodeTo recursively deletes dead nodes from the DAG. +/// As a consequence it isn't appropriate to use from within the DAG combiner or +/// the legalizer which maintain worklists that would need to be updated when +/// deleting things. SDNode *SelectionDAG::MorphNodeTo(SDNode *N, unsigned Opc, SDVTList VTs, ArrayRef<SDValue> Ops) { unsigned NumOps = Ops.size(); |