diff options
author | Duncan Sands <baldrick@free.fr> | 2008-02-26 11:21:42 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-02-26 11:21:42 +0000 |
commit | 212a11c417e272cc8fd12e66cfe5110c47559e17 (patch) | |
tree | 0238620a3d383a2c44cf96f4913892958190294f /lib/CodeGen/SelectionDAG/LegalizeTypes.h | |
parent | 85db3a96b49e4fdb130b55f27e1d5596e771795a (diff) |
Fix a nasty bug in LegalizeTypes (spotted in
CodeGen/PowerPC/illegal-element-type.ll): suppose
a node X is processed, and processing maps it to
a node Y. Then X continues to exist in the DAG,
but with no users. While processing some other
node, a new node may be created that happens to
be equal to X, and thus X will be reused rather
than a truly new node. This can cause X to
"magically reappear", and since it is in the
Processed state in will not be reprocessed, so
at the end of type legalization the illegal node
X can still be present. The solution is to replace
X with Y whenever X gets resurrected like this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47601 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeTypes.h')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeTypes.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypes.h b/lib/CodeGen/SelectionDAG/LegalizeTypes.h index 047c0582d4..7e8ea6640d 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeTypes.h +++ b/lib/CodeGen/SelectionDAG/LegalizeTypes.h @@ -117,16 +117,16 @@ public: void run(); - /// ReanalyzeNodeFlags - Recompute the NodeID flags for the specified node, - /// adding it to the worklist if ready. - void ReanalyzeNodeFlags(SDNode *N) { + /// ReanalyzeNode - Recompute the NodeID and correct processed operands + /// for the specified node, adding it to the worklist if ready. + void ReanalyzeNode(SDNode *N) { N->setNodeId(NewNode); - MarkNewNodes(N); + AnalyzeNewNode(N); } - + private: - void MarkNewNodes(SDNode *N); - + void AnalyzeNewNode(SDNode *&N); + void ReplaceValueWith(SDOperand From, SDOperand To); void ReplaceNodeWith(SDNode *From, SDNode *To); |