[llvm-commits] [llvm] r46705 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
Duncan Sands
baldrick at free.fr
Mon Feb 4 01:29:18 PST 2008
Author: baldrick
Date: Mon Feb 4 03:29:17 2008
New Revision: 46705
URL: http://llvm.org/viewvc/llvm-project?rev=46705&view=rev
Log:
I don't see how NodeUpdated can be called with a
ReadyToProcess node - add an assertion to check
this. Add an assertion to NodeDeleted that checks
that processed/ready nodes are indeed not deleted.
It is because they are never deleted that none of
the maps can have a deleted node as the source of
a mapping. It does however seem to be possible in
theory to have a deleted value as the target of a
mapping, however this has not yet been spotted in
the wild. Still mulling on what to do about this.
[The theoretical situation is this: a node A is
expanded/promoted/whatever to a newly created node
B. Thus A->B is added to a map. When the subtree
rooted at B is legalized it is conceivable that B
is deleted due to RAUW on a node somewhere above
it].
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp?rev=46705&r1=46704&r2=46705&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Mon Feb 4 03:29:17 2008
@@ -220,22 +220,27 @@
namespace {
/// NodeUpdateListener - This class is a DAGUpdateListener that listens for
/// updates to nodes and recomputes their ready state.
- class VISIBILITY_HIDDEN NodeUpdateListener :
+ class VISIBILITY_HIDDEN NodeUpdateListener :
public SelectionDAG::DAGUpdateListener {
DAGTypeLegalizer &DTL;
public:
NodeUpdateListener(DAGTypeLegalizer &dtl) : DTL(dtl) {}
-
+
virtual void NodeDeleted(SDNode *N) {
// Ignore deletes.
+ assert(N->getNodeId() != DAGTypeLegalizer::Processed &&
+ N->getNodeId() != DAGTypeLegalizer::ReadyToProcess &&
+ "RAUW deleted processed node!");
}
-
+
virtual void NodeUpdated(SDNode *N) {
// Node updates can mean pretty much anything. It is possible that an
// operand was set to something already processed (f.e.) in which case
// this node could become ready. Recompute its flags.
- if (N->getNodeId() != DAGTypeLegalizer::ReadyToProcess)
- DTL.ReanalyzeNodeFlags(N);
+ assert(N->getNodeId() != DAGTypeLegalizer::Processed &&
+ N->getNodeId() != DAGTypeLegalizer::ReadyToProcess &&
+ "RAUW updated processed node!");
+ DTL.ReanalyzeNodeFlags(N);
}
};
}
More information about the llvm-commits
mailing list