llvm-project/llvm/test/Transforms/DeadStoreElimination
luxufan f079ba76cf [DSE] Eliminate noop store even through has clobbering between LoadI and StoreI
For noop store of the form of LoadI and StoreI,
An invariant should be kept is that the memory state of the related
MemoryLoc before LoadI is the same as before StoreI.
For this example:
```
define void @pr49927(i32* %q, i32* %p) {
  %v = load i32, i32* %p, align 4
  store i32 %v, i32* %q, align 4
  store i32 %v, i32* %p, align 4
  ret void
}
```
Here the definition of the store's destination is different with the
definition of the load's destination, which it seems that the
invariant mentioned above is broken. But the definition of the
store's destination would write a value that is LoadI, actually, the
invariant is still kept. So we can safely ignore it.

Fixes https://github.com/llvm/llvm-project/issues/49271

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D132657
2022-09-29 00:51:56 +00:00
..
X86
2011-03-25-DSEMiscompile.ll
2011-09-06-EndOfFunction.ll
2011-09-06-MemCpy.ll
2016-07-17-UseAfterFree.ll tests: add attributes that would normally come from inferattrs 2022-07-25 17:29:00 -04:00
OverwriteStoreBegin.ll
OverwriteStoreEnd.ll
PartialStore.ll
PartialStore2.ll
assume.ll [CaptureTracking] Ignore ephemeral values in EarliestEscapeInfo 2022-04-08 10:07:26 -07:00
atomic-overlapping.ll
atomic-todo.ll [NFC][llvm] Inclusive language: reword uses of sanity test and check 2021-11-25 07:21:42 -05:00
atomic.ll [NFC][llvm] Inclusive language: reword uses of sanity test and check 2021-11-25 07:21:42 -05:00
calloc-store.ll tests: add attributes that would normally come from inferattrs 2022-07-25 17:29:00 -04:00
captures-before-call.ll
captures-before-load.ll
combined-partial-overwrites.ll
const-pointers.ll
crash.ll
cs-cs-aliasing.ll
debug-counter.ll
debuginfo.ll
dependent-capture.ll [DSE] Revisit pointers that may no longer escape after removing another store 2022-07-19 09:30:34 -07:00
dominate.ll
fence-todo.ll
fence.ll
free.ll tests: add attributes that would normally come from inferattrs 2022-07-25 17:29:00 -04:00
inst-limits.ll
int_sideeffect.ll
invariant.start.ll [DSE][MemLoc] Handle intrinsics more generically 2021-12-24 09:29:57 +01:00
launder.invariant.group.ll
libcalls-darwin.ll [BuildLibCalls] Add nounwind,willreturn to memset_pattern{4,8,16}. 2022-01-12 10:32:53 +00:00
libcalls.ll [DSE] Add additional memset_chk tests. 2021-12-06 13:06:11 +00:00
lifetime.ll
loop-invariant-entry-block.ll
masked-dead-store-inseltpoison.ll
masked-dead-store.ll [DSE] Add value type info checks for masked store candidates in Dead Store Elimination. 2022-09-20 15:54:25 -07:00
mda-with-dbg-values.ll
memcpy-complete-overwrite.ll
memcpy-lifetimes.ll
memintrinsics.ll
memory-intrinsics-sizes.ll
memoryssa-scan-limit.ll
memset-and-memcpy.ll
memset-missing-debugloc.ll
memset-unknown-sizes.ll [DSE] Make test more robust (NFC) 2022-01-11 11:49:52 +01:00
merge-stores-big-endian.ll
merge-stores.ll
multiblock-captures.ll
multiblock-exceptions.ll
multiblock-loop-carried-dependence.ll [DSE] Add extra test for loop invariant store in loop, update comments. 2022-08-29 17:00:00 +01:00
multiblock-loops.ll
multiblock-malloc-free.ll [DSE] Add additional uses to tests to ensure stores be removed. 2022-08-22 10:21:50 +01:00
multiblock-memintrinsics.ll [DSE] Support looking through memory phis at end of function. 2022-08-30 13:27:51 +01:00
multiblock-memoryphis.ll
multiblock-multipath-throwing.ll
multiblock-multipath.ll
multiblock-overlap.ll
multiblock-partial.ll
multiblock-simple.ll
multiblock-throwing.ll [DSE] Add test cases with more complex redundant stores. 2021-10-22 13:50:32 +01:00
multiblock-unreachable.ll [DSE] Fall back to CFG scan for unreachable terminators. 2022-02-16 14:06:40 +00:00
no-targetdata.ll
noop-stores.ll [DSE] Eliminate noop store even through has clobbering between LoadI and StoreI 2022-09-29 00:51:56 +00:00
nounwind-invoke.ll [DSE] Don't remove nounwind invokes 2022-06-21 11:54:09 -07:00
offsetted-overlapping-stores.ll
opaque-ptr.ll
operand-bundles.ll tests: add attributes that would normally come from inferattrs 2022-07-25 17:29:00 -04:00
out-of-bounds-stores.ll [DSE] Add test case with multiple inbounds stores, followed by OOB. 2021-11-12 09:40:03 +00:00
overlap.ll
phi-translation.ll [DSE] Support looking through memory phis at end of function. 2022-08-30 13:27:51 +01:00
pr11390.ll
pr47285-not-overwritten-on-all-exit-paths.ll
read-clobber-after-overwrite.ll
scoped-noalias.ll
simple-preservation.ll
simple.ll [InstCombine] Tighten up known library function signature tests (PR #56463) 2022-08-10 14:15:46 -06:00
stats.ll
store-after-loop.ll [DSE] Fix invalid removal of store instruction 2021-12-22 16:11:23 -05:00
stores-of-existing-values.ll [DSE] Eliminate noop store even through has clobbering between LoadI and StoreI 2022-09-29 00:51:56 +00:00
tail-byval.ll
trivial-dse-calls.ll [tests] Add coverage of writeonly attribute and operand bundle intersection 2022-01-18 12:08:14 -08:00
wrong-malloc-size.ll [TLI] Check that malloc argument has type size_t 2022-03-14 17:22:24 +01:00