OSDN Git Service

[SDAG] Fix a case where we would iteratively legalize a node during
authorChandler Carruth <chandlerc@gmail.com>
Thu, 14 Aug 2014 01:07:37 +0000 (01:07 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 14 Aug 2014 01:07:37 +0000 (01:07 +0000)
commit14ee003f1ae76cd6594a649e583717bfe92823a8
tree474007bb30b58e7eb134941aaa7899fe8ba18420
parent53f3421d3060d4e717fd4ac41dabcffcdeb7eb42
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215611 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
test/CodeGen/X86/vector-shuffle-128-v16.ll