Skip to content

Commit 7920805

Browse files
committed
[DAG] Use recursivelyDeleteUnusedNodes in ReplaceLoadWithPromotedLoad
It simplifies the code overall and removes the need for manual bookkeeping. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D130444
1 parent 76d9ae9 commit 7920805

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,11 +1263,12 @@ void DAGCombiner::ReplaceLoadWithPromotedLoad(SDNode *Load, SDNode *ExtLoad) {
12631263

12641264
LLVM_DEBUG(dbgs() << "\nReplacing.9 "; Load->dump(&DAG); dbgs() << "\nWith: ";
12651265
Trunc.dump(&DAG); dbgs() << '\n');
1266-
WorklistRemover DeadNodes(*this);
1266+
12671267
DAG.ReplaceAllUsesOfValueWith(SDValue(Load, 0), Trunc);
12681268
DAG.ReplaceAllUsesOfValueWith(SDValue(Load, 1), SDValue(ExtLoad, 1));
1269-
deleteAndRecombine(Load);
1269+
12701270
AddToWorklist(Trunc.getNode());
1271+
recursivelyDeleteUnusedNodes(Load);
12711272
}
12721273

12731274
SDValue DAGCombiner::PromoteOperand(SDValue Op, EVT PVT, bool &Replace) {

0 commit comments

Comments
 (0)