[all-commits] [llvm/llvm-project] ae64c5: [DSE][MemLoc] Handle intrinsics more generically

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Dec 24 00:31:43 PST 2021

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ae64c5a0fde55ca53d0c9949562a506e784da66c
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2021-12-24 (Fri, 24 Dec 2021)

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

  Log Message:
  [DSE][MemLoc] Handle intrinsics more generically

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 memory intrinsics and lifetime markers to be removable.

This allows us to perform DSE on intrinsics that DSE has not been
specially 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.

Differential Revision: https://reviews.llvm.org/D116210

More information about the All-commits mailing list