[PATCH] D130447: [DAG] Use recursivelyDeleteUnusedNodes in PromoteLoad

Amaury SECHET via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 24 18:25:50 PDT 2022


deadalnix created this revision.
deadalnix added reviewers: RKSimon, craig.topper, efriedma, spatel.
Herald added subscribers: StephenFan, ecnelises, hiraditya.
Herald added a project: All.
deadalnix requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

It simplifies the code overall and removes the need for manual bookkeeping.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130447

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -1522,13 +1522,15 @@
 
     LLVM_DEBUG(dbgs() << "\nPromoting "; N->dump(&DAG); dbgs() << "\nTo: ";
                Result.dump(&DAG); dbgs() << '\n');
-    WorklistRemover DeadNodes(*this);
+
     DAG.ReplaceAllUsesOfValueWith(SDValue(N, 0), Result);
     DAG.ReplaceAllUsesOfValueWith(SDValue(N, 1), NewLD.getValue(1));
-    deleteAndRecombine(N);
+
+    recursivelyDeleteUnusedNodes(N);
     AddToWorklist(Result.getNode());
     return true;
   }
+
   return false;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130447.447167.patch
Type: text/x-patch
Size: 699 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220725/c30c1559/attachment.bin>


More information about the llvm-commits mailing list