[PATCH] D117236: [Inliner] Don't removeDeadConstantUsers() when checking if a function is dead

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 13 14:16:25 PST 2022


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/lib/Transforms/IPO/Inliner.cpp:949
       if (Callee.isDiscardableIfUnused()) {
-        // To check this we also need to nuke any dead constant uses (perhaps
-        // made dead by this operation on other functions).
-        Callee.removeDeadConstantUsers();
-        if (Callee.use_empty() && !CG.isLibFunction(Callee)) {
+        if (Callee.hasZeroLiveUses() && !CG.isLibFunction(Callee)) {
           if (Callee.hasLocalLinkage() || !Callee.hasComdat()) {
----------------
You can merge the if blocks as well.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117236/new/

https://reviews.llvm.org/D117236



More information about the llvm-commits mailing list