[NFC][DAGCombiner]: Only consider nodes with no uses for pruning when forming initial...
authorDhruv Chawla <44582521+dc03@users.noreply.github.com>
Wed, 24 May 2023 07:25:22 +0000 (12:55 +0530)
committerDhruv Chawla <44582521+dc03@users.noreply.github.com>
Thu, 25 May 2023 14:18:30 +0000 (19:48 +0530)
commit51572c2cd7200552280599fbc68d016bb1f18934
treeff4c1102f318e852efdab589c57234e8eb881865
parent6a939aa80ace806bcf5957dbc96876243c31797b
[NFC][DAGCombiner]: Only consider nodes with no uses for pruning when forming initial worklist

When the worklist is initially being formed, there is no need to
consider all nodes for pruning. This is because the first time calling
getNextWorklistEntry will only clear those nodes which have no uses,
with their operands being added to the worklist. However, when the worklist is
created for the first time all nodes are added anyways, so this operation
actually ends up adding no nodes.

This patch adds a parameter IsCandidateForPruning to AddToWorklist with a
default value of true to avoid having to update every call site.

Differential Revision: https://reviews.llvm.org/D151416
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp