diff options
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelDAGToDAG.cpp | 5 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/fold-call-3.ll | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp index c16fbe03ec5..450872d8619 100644 --- a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -907,6 +907,11 @@ void X86DAGToDAGISel::PreprocessISelDAG() { ++I; CurDAG->DeleteNode(N); } + + // The load+call transform above can leave some dead nodes in the graph. Make + // sure we remove them. Its possible some of the other transforms do to so + // just remove dead nodes unconditionally. + CurDAG->RemoveDeadNodes(); } // Look for a redundant movzx/movsx that can occur after an 8-bit divrem. diff --git a/llvm/test/CodeGen/X86/fold-call-3.ll b/llvm/test/CodeGen/X86/fold-call-3.ll index e7e81b9422a..840a32447f1 100644 --- a/llvm/test/CodeGen/X86/fold-call-3.ll +++ b/llvm/test/CodeGen/X86/fold-call-3.ll @@ -1,5 +1,7 @@ ; RUN: llc < %s -mtriple=x86_64-apple-darwin | grep call | grep 560 ; rdar://6522427 +; This command line used to crash due to dangling nodes left after PreprocessISelDAG +; RUN: llc < %s -mtriple=x86_64-apple-darwin -pre-RA-sched=linearize %"struct.clang::Action" = type { %"struct.clang::ActionBase" } %"struct.clang::ActionBase" = type { i32 (...)** } |

