]> granicus.if.org Git - llvm/commitdiff
[DAG] Aggressively cleanup dangling node in CombineZExtLogicopShiftLoad.
authorNirav Dave <niravd@google.com>
Thu, 31 Jan 2019 19:35:14 +0000 (19:35 +0000)
committerNirav Dave <niravd@google.com>
Thu, 31 Jan 2019 19:35:14 +0000 (19:35 +0000)
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

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index d2e235189ec9424d48d41f550a7732796e3ba964..1f05a435bbe646ae78117d6a34791cde6d0e20ce 100644 (file)
@@ -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!
 }