[PATCH] D140411: SCCP: Don't assert on constantexpr casts of function uses

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 21 02:59:58 PST 2022


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

LG

> I don't know who is responsible for cleaning up unused ConstantExprs, but I've run into similar issues several times recently.

I guess in this particular case SCCP could clean them up (it already does so for GlobalVariables, see the removeDeadConstantUsers() call). It's also possible to ignore them via hasZeroLiveUses().



================
Comment at: llvm/lib/Transforms/IPO/SCCP.cpp:350
+      // FIXME: Could this be a ConstantExpr cast user with a use in a call site
+      // that needs to be handled?
       for (Use &Arg : CB->args())
----------------
If I understood things correctly, I don't think so: We only look through casts for assume-like intrinsics, and for those it's not a call use, so there's no attributes to drop.


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

https://reviews.llvm.org/D140411



More information about the llvm-commits mailing list