[PATCH] D40480: MemorySSA backed Dead Store Elimination.

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 27 02:04:15 PST 2017


dmgreen created this revision.

This is an upgrade of DSE to use MemorySSA, not MemDeps. Which allows in to work across basic blocks in a sparser manner.

Halfway into making this I found https://reviews.llvm.org/D29624, which is an attempt at the same thing, so I stole all their good ideas. There is also https://reviews.llvm.org/D29866, which is a PDSE pass by the same author. As far as I understand, that would be superior but harder to write. Unfortunately both seem to have been abandoned.

I believe this version should handle everything that the old memdeps version does (it passes all the tests). This includes complete overwrite (so long as the later store postdoms), noop stores, partial overwrites, stores before frees/lifetime_ends and PartialEarlierWithFullLater.

The only exception that I know of is for the coroutine tests, which rely on removing stores to soon to be freed data, even across function calls that may throw. See test37 in simple.ll and ex3.ll in coroutine tests. It should be possible to get that working but might involve looking through the llvm.coro.begin.

Putting up for early review, I need to do some extra testing/benchmarking/compile time etc. Added subscribers from anyone who looked interested in https://reviews.llvm.org/D29624. This is a fairly big chunk of code, let me know if I can do anything to make it easier to review.


https://reviews.llvm.org/D40480

Files:
  lib/Transforms/Scalar/DeadStoreElimination.cpp
  test/Transforms/DeadStoreElimination/merge-stores-big-endian.ll
  test/Transforms/DeadStoreElimination/merge-stores.ll
  test/Transforms/DeadStoreElimination/multiblock.ll
  test/Transforms/DeadStoreElimination/simple.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40480.124334.patch
Type: text/x-patch
Size: 48774 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171127/eb70ee50/attachment.bin>


More information about the llvm-commits mailing list