llvm-project/llvm/test/Transforms/NewGVN
modimo 1860331932 [MemCpyOpt] Correctly merge alias scopes during call slot optimization
When MemCpyOpt performs call slot optimization it will concatenate the `alias.scope` metadata between the function call and the memcpy. However, scoped AA relies on the domains in metadata to be maintained in a caller-callee relationship. Naive concatenation breaks this assumption leading to bad AA results.

The fix is to take the intersection of domains then union the scopes within those domains.

The original bug came from a case of rust bad codegen which uses this bad aliasing to perform additional memcpy optimizations. As show in the added test case `%src` got forwarded past its lifetime leading to a dereference of garbage data.

Testing
ninja check-llvm

Reviewed By: jeroen.dobbelaere

Differential Revision: https://reviews.llvm.org/D91576
2020-12-03 09:23:37 -08:00
..
2007-07-25-DominatedLoop.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2007-07-25-InfiniteLoop.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
2007-07-25-Loop.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2007-07-25-NestedLoop.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2007-07-25-SinglePredecessor.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2007-07-26-InterlockingLoops.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
2007-07-26-NonRedundant.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2007-07-26-PhiErasure.ll [NewGVN] Remove unused check-prefixes 2020-11-09 12:18:19 +00:00
2007-07-30-PredIDom.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2007-07-31-NoDomInherit-xfail.ll [NewGVN] Rename xfail tests (NFC) 2020-07-13 21:07:03 +02:00
2007-07-31-RedundantPhi.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
2008-02-12-UndefLoad-xfail.ll [NewGVN] Rename xfail tests (NFC) 2020-07-13 21:07:03 +02:00
2008-02-13-NewPHI.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2008-07-02-Unreachable.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
2008-12-09-SelfRemove.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2008-12-12-RLE-Crash.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2008-12-14-rle-reanalyze.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2008-12-15-CacheVisited.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2009-01-21-SortInvalidation.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2009-01-22-SortInvalidation.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2009-03-10-PREOnVoid.ll OpaquePtr: Bulk update tests to use typed sret 2020-11-20 17:58:26 -05:00
2009-07-13-MemDepSortFail.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2009-11-12-MemDepMallocBitCast.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2010-03-31-RedundantPHIs.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
2010-05-08-OneBit.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2010-11-13-Simplify.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
2011-04-27-phioperands.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2011-07-07-MatchIntrinsicExtract.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2011-09-07-TypeIdFor.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
2012-05-22-PreCrash.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2016-08-30-MaskedScatterGather-xfail.ll [NewGVN] Rename xfail tests (NFC) 2020-07-13 21:07:03 +02:00
MemdepMiscompile.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
addrspacecast.ll NewGVN: Handle addrspacecast 2019-06-05 21:15:52 +00:00
assume-equal-xfail.ll [NewGVN] Separate passing assume tests (NFC) 2020-07-13 21:07:03 +02:00
assume-equal.ll [PredicateInfo] Place predicate info after assume 2020-07-13 21:10:11 +02:00
assumes.ll [PredicateInfo] Place predicate info after assume 2020-07-13 21:10:11 +02:00
basic-cyclic-opt.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
basic-undef-test.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
basic.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
big-endian.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
bitcast-of-call.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
br-identical.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
calloc-load-removal.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
calls-nonlocal-xfail.ll [NewGVN] Rename xfail tests (NFC) 2020-07-13 21:07:03 +02:00
calls-readonly.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
commute.ll [GVN] add tests for >2 arg commutable intrinsics; NFC 2020-09-03 10:14:52 -04:00
completeness.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
cond_br.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
cond_br2-xfail.ll [NewGVN] Rename xfail tests (NFC) 2020-07-13 21:07:03 +02:00
condprop-xfail.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
condprop.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
crash-no-aa.ll [BasicAA] Rename -disable-basicaa to -disable-basic-aa to be consistent with the canonical name "basic-aa" 2020-06-26 20:55:44 -07:00
crash.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
cyclic-phi-handling.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
dbg-redundant-load.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
deadstore.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
debugloc-xfail.ll [NewGVN] Rename xfail tests (NFC) 2020-07-13 21:07:03 +02:00
edge.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
eliminate-callsite-inline.ll [test] Fix eliminate-callsite-inline.ll under NPM 2020-11-18 12:39:39 -08:00
eliminate-ssacopy.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
equivalent-phi.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
fence-xfail.ll [NewGVN] Rename xfail tests (NFC) 2020-07-13 21:07:03 +02:00
flags-simplify.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
flags.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
fold-const-expr.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
fpmath.ll [NFC][NewGVN] Explicitly check fpmath metadata in fpmath.ll 2019-06-28 21:39:08 +00:00
funclet.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
int_sideeffect.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
invariant.group-xfail.ll [NewGVN] Rename xfail tests (NFC) 2020-07-13 21:07:03 +02:00
invariant.start.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
lifetime-simple.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
load-constant-mem.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
load-from-unreachable-predecessor.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
loadforward.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
malloc-load-removal.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
memory-handling.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
metadata-nonnull.ll Infer alignment of unmarked loads in IR/bitcode parsing. 2020-05-14 13:03:50 -07:00
metadata-simplify.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
no_speculative_loads_with_asan.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
noalias.ll [MemCpyOpt] Correctly merge alias scopes during call slot optimization 2020-12-03 09:23:37 -08:00
non-integral-pointers.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
non-local-offset.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
nonescaping-malloc-xfail.ll [NewGVN] Rename xfail tests (NFC) 2020-07-13 21:07:03 +02:00
null-aliases-nothing.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
opt-remarks-xfail.ll [NewGVN] Rename xfail tests (NFC) 2020-07-13 21:07:03 +02:00
pair_jumpthread.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
phi-edge-handling.ll Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" as cleanups after D56351 2019-12-24 15:57:33 -08:00
phi-of-ops-move-block.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
phi-translate-partial-alias.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
pr10820-xfail.ll [NewGVN] Rename xfail tests (NFC) 2020-07-13 21:07:03 +02:00
pr12979.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr14166-xfail.ll [NewGVN] Rename xfail tests (NFC) 2020-07-13 21:07:03 +02:00
pr17732.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr17852.ll OpaquePtr: Bulk update tests to use typed byval 2020-11-20 14:00:46 -05:00
pr24397.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
pr24426.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr25440.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr28562.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr31472.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
pr31483.ll Re-land "[PowerPC] Remove QPX/A2Q BGQ/BGP CNK support" 2020-07-28 14:00:11 +00:00
pr31491.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
pr31501.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
pr31573.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
pr31594.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
pr31613.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
pr31682.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
pr31758.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr32403.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr32607.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr32836.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr32838.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr32845.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr32852.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr32897.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr32934.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr32945.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr32952.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr33014.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr33086.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr33116.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr33165-distribute-undef.ll [InstSimplify/NewGVN] Add option to control the use of undef. 2020-08-09 19:16:56 +01:00
pr33185.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr33187.ll Require "target datalayout" to be at the beginning of an IR file. 2020-04-20 11:55:49 -07:00
pr33196.ll [NewPM] Add -basic-aa to pr33196.ll 2020-07-02 11:27:52 -07:00
pr33204.ll StoreInst should store Align, not MaybeAlign 2020-05-15 12:26:58 -07:00
pr33305.ll Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" as cleanups after D56351 2019-12-24 15:57:33 -08:00
pr33367.ll AllocaInst should store Align instead of MaybeAlign. 2020-05-16 14:53:16 -07:00
pr33432.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr33461.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr33720.ll StoreInst should store Align, not MaybeAlign 2020-05-15 12:26:58 -07:00
pr34135.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr34430.ll Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" as cleanups after D56351 2019-12-24 15:57:33 -08:00
pr34452.ll Migrate function attribute "no-frame-pointer-elim"="false" to "frame-pointer"="none" as cleanups after D56351 2019-12-24 16:27:51 -08:00
pr35074.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr35125.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr43441.ll [NewGVN] Check that call has an access. 2019-10-15 17:25:36 +00:00
pre-compare.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pre-new-inst-xfail.ll [NewGVN] Rename xfail tests (NFC) 2020-07-13 21:07:03 +02:00
predicates.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
preserve-metadata-for-predicate-replacements.ll [NewGVN] Add test to ensure metadata is preserved for ssa_copy (NFC) 2020-06-03 19:30:03 +01:00
propagate-ir-flags.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
range.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
readattrs.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
refine-stores.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
rle-must-alias-xfail.ll [NewGVN] Rename xfail tests (NFC) 2020-07-13 21:07:03 +02:00
rle-no-phi-translate-xfail.ll [NewGVN] Rename xfail tests (NFC) 2020-07-13 21:07:03 +02:00
rle-nonlocal.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
rle.ll [DIE] Remove DeadInstEliminationPass 2020-09-21 12:12:25 -07:00
simp-to-self.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
stale-loop-info.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
storeoverstore.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
tbaa.ll [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN 2020-06-26 20:28:18 -07:00
todo-pr35074-phi-of-ops.ll [NewGVN] Require asserts for crashing tests. 2020-07-29 12:41:05 +01:00
todo-pr36335-phi-undef.ll [NewGVN] Add test cases for remaining known issues. 2020-07-28 20:33:04 +01:00
todo-pr37121-seens-this-value-a-lot.ll [NewGVN] Require asserts for crashing tests. 2020-07-29 12:41:05 +01:00
todo-pr42422-phi-of-ops.ll Fix typo in test. Thanks to Andrew Ng for spotting this! 2020-08-05 22:56:15 -07:00
unreachable_block_infinite_loop.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
verify-memoryphi.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
volatile-nonvolatile.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00