[PATCH] D116210: [DSE][MemLoc] Handle intrinsics more generically
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 23 07:42:13 PST 2021
nikic added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:185
- if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(I)) {
- switch (II->getIntrinsicID()) {
- default: llvm_unreachable("Does not have LocForWrite");
- case Intrinsic::lifetime_end:
- // Never remove dead lifetime_end's, e.g. because it is followed by a
- // free.
+ // Note: only get here for calls with analyzable writes.
+ if (auto *CB = dyn_cast<CallBase>(I)) {
----------------
fhahn wrote:
> might be worth an assert here
In some cases we call isRemovable() before getLocForWriteEx() (but still bail out if either fails). I could add an assert after reordering the calls.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116210/new/
https://reviews.llvm.org/D116210
More information about the llvm-commits
mailing list