[PATCH] D109294: [Inline] Remove dead users before checking if function has one use (PR51667)

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 10 11:25:37 PDT 2021


aeubanks added a comment.

(moving this to a main thread so we don't have to reply to a thread on code in an old revision)

hmm, does removing dead constant users invalidate analyses? that's an interesting question. I guess technically yes it should, although not sure it'll matter in practice.

I think we have three options

1. mtrofin's original idea of adding a cleanup pass before the inliner that calls removeDeadConstantUsers on each function, and we invalidate non-cfg analyses if we make any changes
2. add `Constant::hasOneLiveUse()` and use that in InlineCost.cpp rather than modifying IR
3. keep doing what we're doing here and assume that no analyses rely on dead constant users

imo we can get away with the current patch
any thoughts?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109294



More information about the llvm-commits mailing list