From: Nirav Dave Date: Thu, 31 Jan 2019 19:35:14 +0000 (+0000) Subject: [DAG] Aggressively cleanup dangling node in CombineZExtLogicopShiftLoad. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6980a884f19f17bea78f1f2921f1c1197a1195ed;p=llvm [DAG] Aggressively cleanup dangling node in CombineZExtLogicopShiftLoad. While dangling nodes will eventually be pruned when they are considered, leaving them disables combines requiring single-use. Reviewers: Carrot, spatel, craig.topper, RKSimon, efriedma Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D57520 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352784 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index d2e235189ec..1f05a435bbe 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -8465,6 +8465,10 @@ SDValue DAGCombiner::CombineZExtLogicopShiftLoad(SDNode *N) { Load->getValueType(0), ExtLoad); CombineTo(Load, Trunc, ExtLoad.getValue(1)); } + + // N0 is dead at this point. + recursivelyDeleteUnusedNodes(N0.getNode()); + return SDValue(N,0); // Return N so it doesn't get rechecked! }