diff options
author | Hal Finkel <hfinkel@anl.gov> | 2012-04-16 03:33:22 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2012-04-16 03:33:22 +0000 |
commit | e0cf6397fd266caeb3e9ca46686264fb6a3f9b3a (patch) | |
tree | f8087fc7a68caa9f176d9b7a86f224a153c82467 | |
parent | 247b4d54edbd610b9dc8907443fdf23081a8df67 (diff) | |
download | bcm5719-llvm-e0cf6397fd266caeb3e9ca46686264fb6a3f9b3a.tar.gz bcm5719-llvm-e0cf6397fd266caeb3e9ca46686264fb6a3f9b3a.zip |
Remove dead SD nodes after the combining pass. Fixes PR12201.
llvm-svn: 154786
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 1 | ||||
-rw-r--r-- | llvm/test/CodeGen/PowerPC/ppc-vaarg-agg.ll | 46 |
2 files changed, 47 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index d1b998f8d84..0914c662766 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -1080,6 +1080,7 @@ void DAGCombiner::Run(CombineLevel AtLevel) { // If the root changed (e.g. it was a dead load, update the root). DAG.setRoot(Dummy.getValue()); + DAG.RemoveDeadNodes(); } SDValue DAGCombiner::visit(SDNode *N) { diff --git a/llvm/test/CodeGen/PowerPC/ppc-vaarg-agg.ll b/llvm/test/CodeGen/PowerPC/ppc-vaarg-agg.ll new file mode 100644 index 00000000000..d5ea044599e --- /dev/null +++ b/llvm/test/CodeGen/PowerPC/ppc-vaarg-agg.ll @@ -0,0 +1,46 @@ +target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32" +target triple = "powerpc-montavista-linux-gnuspe" +; RUN: llc < %s -march=ppc32 | FileCheck %s + +%struct.__va_list_tag.0.9.18.23.32.41.48.55.62.67.72.77.82.87.90.93.96.101.105 = type { i8, i8, i16, i8*, i8* } + +define fastcc void @test1(%struct.__va_list_tag.0.9.18.23.32.41.48.55.62.67.72.77.82.87.90.93.96.101.105* %args) { +entry: + br i1 undef, label %repeat, label %maxlen_reached + +repeat: ; preds = %entry + switch i32 undef, label %sw.bb323 [ + i32 77, label %sw.bb72 + i32 111, label %sw.bb309 + i32 80, label %sw.bb313 + i32 117, label %sw.bb326 + i32 88, label %sw.bb321 + ] + +sw.bb72: ; preds = %repeat + unreachable + +sw.bb309: ; preds = %repeat + unreachable + +sw.bb313: ; preds = %repeat + unreachable + +sw.bb321: ; preds = %repeat + unreachable + +sw.bb323: ; preds = %repeat + %0 = va_arg %struct.__va_list_tag.0.9.18.23.32.41.48.55.62.67.72.77.82.87.90.93.96.101.105* %args, i32 + unreachable + +sw.bb326: ; preds = %repeat + unreachable + +maxlen_reached: ; preds = %entry + ret void +} + +; If the SD nodes are not cleaup up correctly, then this can fail to compile +; with an error like: Cannot select: ch = setlt [ID=6] +; CHECK: @test1 + |