[PATCH] D116210: [DSE][MemLoc] Handle intrinsics more generically

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 23 00:55:59 PST 2021


nikic created this revision.
nikic added reviewers: reames, fhahn, anna.
Herald added a subscriber: hiraditya.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Remove the special casing for intrinsics in `MemoryLocation::getForDest()` and handle them through the general attribute based code. On the DSE side, this means that `isRemovable()` now needs to handle more than a hardcoded list of intrinsics. We consider everything apart from volatile accesses memory intrinsics and lifetime markers to be removable.

This allows us to perform DSE on intrinsics that DSE has not been specially been taught about, using a matrix store as an example here.

There is an interesting test change for `invariant.start`, but I believe that optimization is correct. It only looks a bit odd because the code is immediate UB anyway.


https://reviews.llvm.org/D116210

Files:
  llvm/lib/Analysis/MemoryLocation.cpp
  llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
  llvm/test/Transforms/DeadStoreElimination/invariant.start.ll
  llvm/test/Transforms/DeadStoreElimination/simple.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116210.395994.patch
Type: text/x-patch
Size: 4581 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211223/2581069c/attachment.bin>


More information about the llvm-commits mailing list