summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-08-14 01:07:37 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-08-14 01:07:37 +0000
commit8039b16de7ec8a953c0209828fb94b0b263cf6c8 (patch)
tree348b444c92d68763e02087fcc44e7f77e7328680 /llvm/lib/CodeGen
parent5601dc40b463f794f0bdff491a75f3ac15eb5fe2 (diff)
downloadbcm5719-llvm-8039b16de7ec8a953c0209828fb94b0b263cf6c8.tar.gz
bcm5719-llvm-8039b16de7ec8a953c0209828fb94b0b263cf6c8.zip
[SDAG] Fix a case where we would iteratively legalize a node during
combining by replacing it with something else but not re-process the node afterward to remove it. In a truly remarkable stroke of bad luck, this would (in the test case attached) end up getting some other node combined into it without ever getting re-processed. By adding it back on to the worklist, in addition to deleting the dead nodes more quickly we also ensure that if it *stops* being dead for any reason it makes it back through the legalizer. Without this, the test case will end up failing during instruction selection due to an and node with a type we don't have an instruction pattern for. It took many million runs of the shuffle fuzz tester to find this. llvm-svn: 215611
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index d689630f72c..232cbd81f76 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -156,6 +156,8 @@ public:
// Node replacement helpers
void ReplacedNode(SDNode *N) {
LegalizedNodes.erase(N);
+ if (UpdatedNodes)
+ UpdatedNodes->insert(N);
}
void ReplaceNode(SDNode *Old, SDNode *New) {
DEBUG(dbgs() << " ... replacing: "; Old->dump(&DAG);
OpenPOWER on IntegriCloud