[X86] If PreprocessISelDAG reorders a load before a call, make sure we remove dead...
authorCraig Topper <craig.topper@intel.com>
Tue, 30 Apr 2019 17:56:47 +0000 (17:56 +0000)
committerCraig Topper <craig.topper@intel.com>
Tue, 30 Apr 2019 17:56:47 +0000 (17:56 +0000)
commit3958719ddafb7459b35ae44255c41940086317a4
treeef6774d339adecd8ad1178d76a52f4f071f38bec
parent965d1306ae42159116df160974847d9d63941018
[X86] If PreprocessISelDAG reorders a load before a call, make sure we remove dead nodes from the graph

The reordering can leave at least a dead TokenFactor in the graph. This cause the linearize scheduler to fail with something like the assert seen in PR22614. This is only one of many ways we can break the linearize scheduler today so I can't say for sure that any of the other failures in that bug were caused by this issue.

This takes the heavy hammer approach of just running RemoveDeadNodes unconditionally at the end of the PreprocessISelDAG. If this turns out to be a compile time hit, we can try to refine it.

Differential Revision: https://reviews.llvm.org/D61164

llvm-svn: 359582
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/test/CodeGen/X86/fold-call-3.ll