llvm-project/llvm/test/Transforms/DeadStoreElimination
David Green 222aeb4d51 [DSE] Remove stores in the same loop iteration
DSE will currently only remove stores in the same block unless they can
be guaranteed to be loop invariant. This expands that to any stores that
are in the same Loop, at the same loop level. This should still account
for where AA/MSSA will not handle aliasing between loops, but allow the
dead stores to be removed where they overlap in the same loop iteration.
It requires adding loop info to DSE, but that looks fairly harmless.

The test case this helps is from code like this, which can come up in
certain matrix operations:
  for(i=..)
    dst[i] = 0;
    for(j=..)
      dst[i] += src[i*n+j];

After LICM, this becomes:
for(i=..)
  dst[i] = 0;
  sum = 0;
  for(j=..)
    sum += src[i*n+j];
  dst[i] = sum;

The first store is dead, and with this patch is now removed.

Differntial Revision: https://reviews.llvm.org/D100464
2021-05-31 10:22:37 +01:00
..
X86 [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
2011-03-25-DSEMiscompile.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
2011-09-06-EndOfFunction.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
2011-09-06-MemCpy.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
2016-07-17-UseAfterFree.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
OverwriteStoreBegin.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
OverwriteStoreEnd.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
PartialStore.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
PartialStore2.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
atomic-overlapping.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
atomic-todo.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
atomic.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
calloc-store.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
combined-partial-overwrites.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
const-pointers.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
crash.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
cs-cs-aliasing.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
debug-counter.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
debuginfo.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
dominate.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
fence-todo.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
fence.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
free.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
inst-limits.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
int_sideeffect.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
invariant.start.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
launder.invariant.group.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
libcalls.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
lifetime.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
loop-invariant-entry-block.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
masked-dead-store-inseltpoison.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
masked-dead-store.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
mda-with-dbg-values.ll Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
memcpy-complete-overwrite.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
memcpy-lifetimes.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
memintrinsics.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
memory-intrinsics-sizes.ll [DSE] Handle memmove with equal non-const sizes 2021-03-10 17:52:00 +01:00
memoryssa-scan-limit.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
memset-and-memcpy.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
memset-missing-debugloc.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
memset-unknown-sizes.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
merge-stores-big-endian.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
merge-stores.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
multiblock-captures.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
multiblock-exceptions.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
multiblock-loop-carried-dependence.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
multiblock-loops.ll [DSE] Remove stores in the same loop iteration 2021-05-31 10:22:37 +01:00
multiblock-malloc-free.ll [IR] Memory intrinsics are not unconditionally `nosync` 2021-05-21 03:40:59 +02:00
multiblock-memintrinsics.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
multiblock-memoryphis.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
multiblock-multipath-throwing.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
multiblock-multipath.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
multiblock-overlap.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
multiblock-partial.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
multiblock-simple.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
multiblock-throwing.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
multiblock-unreachable.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
no-targetdata.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
noop-stores.ll [DSE] Eliminate zero memset after calloc 2021-04-28 03:30:52 +02:00
offsetted-overlapping-stores.ll [DSE] Extending isOverwrite to support offsetted fully overlapping stores 2021-03-10 21:09:33 +01:00
operand-bundles.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
out-of-bounds-stores.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
overlap.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
phi-translation.ll [DSE] Add tests that require phi translation to be removed. 2021-03-10 16:32:55 +00:00
pr11390.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
pr47285-not-overwritten-on-all-exit-paths.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
read-clobber-after-overwrite.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
scoped-noalias.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
simple-preservation.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
simple.ll Reapply "OpaquePtr: Turn inalloca into a type attribute" 2021-03-29 08:55:30 -04:00
stats.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
stores-of-existing-values.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00
tail-byval.ll [DSE] Remove MemDep-based implementation 2021-03-07 18:17:31 +01:00