dead stuff around. This gets fed into the isel pass and causes certain foldings from
happening because nodes have extraneous uses floating around. For example, if we turned
foo(bar(x)) -> baz(x), we sometimes left bar(x) around.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46305
91177308-0d34-0410-b5e6-
96231b3b80d8
// Push the new node and any users onto the worklist
AddToWorkList(RV.Val);
AddUsersToWorkList(RV.Val);
+
+ // Add any uses of the old node to the worklist if they have a single
+ // use. They may be dead after this node is deleted.
+ for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i)
+ AddToWorkList(N->getOperand(i).Val);
// Nodes can be reintroduced into the worklist. Make sure we do not
// process a node that has been replaced.