[PATCH] D130444: [DAG] Use recursivelyDeleteUnusedNodes in ReplaceLoadWithPromotedLoad

Amaury SECHET via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 24 18:01:53 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 bookeeping.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130444

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
@@ -1262,10 +1262,11 @@
 
   LLVM_DEBUG(dbgs() << "\nReplacing.9 "; Load->dump(&DAG); dbgs() << "\nWith: ";
              Trunc.dump(&DAG); dbgs() << '\n');
-  WorklistRemover DeadNodes(*this);
+
   DAG.ReplaceAllUsesOfValueWith(SDValue(Load, 0), Trunc);
   DAG.ReplaceAllUsesOfValueWith(SDValue(Load, 1), SDValue(ExtLoad, 1));
-  deleteAndRecombine(Load);
+
+  recursivelyDeleteUnusedNodes(Load);
   AddToWorklist(Trunc.getNode());
 }
 


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


More information about the llvm-commits mailing list