llvm/test/Analysis/BasicAA
Ahmed Bougacha 9c252165a7 [BasicAA] Try to disambiguate GEPs through arrays of structs into
different fields.

We can show that two GEPs off of the same (possibly multidimensional)
array of structs, into different fields, can't alias.  Quoting:

For two GEPOperators GEP1 and GEP2, if we find that:
- both GEPs begin indexing from the exact same pointer;
- the last indices in both GEPs are constants, indexing into a struct;
- said indices are different, hence,the pointed-to fields are different;
- and both GEPs only index through arrays prior to that;

this lets us determine that the struct that GEP1 indexes into and the
struct that GEP2 indexes into must either precisely overlap or be
completely disjoint.  Because they cannot partially overlap, indexing
into different non-overlapping fields of the struct will never alias.

The other BasicAA::aliasGEP rules worked in some cases, but not all
(for example, the i32x3 struct in the testcase).
We can add this simple ad-hoc rule to complement them.

rdar://19717375
Differential Revision: http://reviews.llvm.org/D7453


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228498 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 17:04:29 +00:00
..
2003-02-26-AccessSizeTest.ll FileCheck-ize these tests. Harden some of them. 2012-04-24 09:15:38 +00:00
2003-03-04-GEPCrash.ll
2003-04-22-GEPProblem.ll FileCheck-ize these tests. Harden some of them. 2012-04-24 09:15:38 +00:00
2003-04-25-GEPCrash.ll
2003-05-21-GEP-Problem.ll
2003-06-01-AliasCrash.ll
2003-07-03-BasicAACrash.ll
2003-09-19-LocalArgument.ll FileCheck-ize these tests. Harden some of them. 2012-04-24 09:15:38 +00:00
2003-11-04-SimpleCases.ll [BasicAA] Add datalayouts to make some tests more useful. NFC. 2015-02-05 21:10:14 +00:00
2003-12-11-ConstExprGEP.ll [BasicAA] Add datalayouts to make some tests more useful. NFC. 2015-02-05 21:10:14 +00:00
2004-07-28-MustAliasbug.ll FileCheck-ize these tests. Harden some of them. 2012-04-24 09:15:38 +00:00
2006-03-03-BadArraySubscript.ll BasicAA: Use reachabilty instead of dominance for checking value equality in phi 2014-01-03 05:47:03 +00:00
2006-11-03-BasicAAVectorCrash.ll
2007-01-13-BasePointerBadNoAlias.ll FileCheck-ize these tests. Harden some of them. 2012-04-24 09:15:38 +00:00
2007-08-01-NoAliasAndCalls.ll Convert the uses of '|&' to use '2>&1 |' instead, which works on old 2012-07-02 18:37:59 +00:00
2007-08-01-NoAliasAndGEP.ll [BasicAA] Add datalayouts to make some tests more useful. NFC. 2015-02-05 21:10:14 +00:00
2007-08-05-GetOverloadedModRef.ll FileCheck-ize these tests. Harden some of them. 2012-04-24 09:15:38 +00:00
2007-10-24-ArgumentsGlobals.ll FileCheck-ize these tests. Harden some of them. 2012-04-24 09:15:38 +00:00
2007-11-05-SizeCrash.ll Reject alias to undefined symbols in the verifier. 2014-03-12 20:15:49 +00:00
2007-12-08-OutOfBoundsCrash.ll Reject alias to undefined symbols in the verifier. 2014-03-12 20:15:49 +00:00
2008-04-15-Byval.ll Delete -std-compile-opts. 2014-10-16 20:00:02 +00:00
2008-06-02-GEPTailCrash.ll
2008-11-23-NoaliasRet.ll Convert the uses of '|&' to use '2>&1 |' instead, which works on old 2012-07-02 18:37:59 +00:00
2009-03-04-GEPNoalias.ll FileCheck-ize these tests. Harden some of them. 2012-04-24 09:15:38 +00:00
2009-10-13-AtomicModRef.ll Enhance alias analysis for atomic instructions a bit. Upgrade a couple alias-analysis tests to the new atomic instructions. 2011-09-26 20:15:28 +00:00
2009-10-13-GEP-BaseNoAlias.ll Convert the uses of '|&' to use '2>&1 |' instead, which works on old 2012-07-02 18:37:59 +00:00
2010-09-15-GEP-SignedArithmetic.ll Convert the uses of '|&' to use '2>&1 |' instead, which works on old 2012-07-02 18:37:59 +00:00
2014-03-18-Maxlookup-reached.ll PR15967 Fix in basicaa for faulty returning no alias. 2014-03-26 21:30:19 +00:00
aligned-overread.ll Teach BasicAA about the LLVM IR rules that allow reading past the end of an object given sufficient alignment. Fixes PR12098. 2012-02-27 20:46:07 +00:00
args-rets-allocas-loads.ll Convert the uses of '|&' to use '2>&1 |' instead, which works on old 2012-07-02 18:37:59 +00:00
assume.ll Add @llvm.assume, lowering, and some basic properties 2014-07-25 21:13:35 +00:00
byval.ll FileCheck-ize these tests. Harden some of them. 2012-04-24 09:15:38 +00:00
cas.ll FileCheck-ize these tests. Harden some of them. 2012-04-24 09:15:38 +00:00
constant-over-index.ll [BasicAA] Add datalayouts to make some tests more useful. NFC. 2015-02-05 21:10:14 +00:00
cs-cs.ll Improve BasicAA CS-CS queries (redux) 2014-07-17 01:28:25 +00:00
dag.ll Convert the uses of '|&' to use '2>&1 |' instead, which works on old 2012-07-02 18:37:59 +00:00
empty.ll Convert the uses of '|&' to use '2>&1 |' instead, which works on old 2012-07-02 18:37:59 +00:00
featuretest.ll
full-store-partial-alias.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
gcsetest.ll CHECK-LABELize test 2014-09-15 17:56:56 +00:00
gep-alias.ll Use correct size for address space in BasicAA. 2013-11-16 00:36:43 +00:00
getmodrefinfo-cs-cs.ll Convert the uses of '|&' to use '2>&1 |' instead, which works on old 2012-07-02 18:37:59 +00:00
global-size.ll Use correct size for address space in BasicAA. 2013-11-16 00:36:43 +00:00
intrinsics.ll Use references to attribute groups on the call/invoke instructions. 2013-02-22 09:09:42 +00:00
invariant_load.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
memset_pattern.ll Teach BasicAA about the aliasing properties of memset_pattern16. 2011-09-06 23:33:25 +00:00
modref.ll CHECK-LABELize test 2014-09-15 17:56:56 +00:00
must-and-partial.ll Convert the uses of '|&' to use '2>&1 |' instead, which works on old 2012-07-02 18:37:59 +00:00
no-escape-call.ll FileCheck-ize these tests. Harden some of them. 2012-04-24 09:15:38 +00:00
noalias-bugs.ll BasicAA: We need to check both access sizes when comparing a gep and an 2014-01-16 04:53:18 +00:00
noalias-geps.ll Use CHECK-LABEL 2013-09-30 23:31:55 +00:00
noalias-param.ll Make BasicAliasAnalysis recognize the fact a noalias argument cannot alias another argument, even if the other argument is not itself marked noalias. 2013-05-28 08:17:48 +00:00
nocapture.ll Don't infer whether a value is captured in the current function from the 2012-11-05 10:48:24 +00:00
phi-aa.ll Revert r219432 - "Revert "[BasicAA] Revert "Revert r218714 - Make better use of zext and sign information.""" 2014-11-13 09:16:54 +00:00
phi-and-select.ll Convert the uses of '|&' to use '2>&1 |' instead, which works on old 2012-07-02 18:37:59 +00:00
phi-spec-order.ll BasicAA: Use reachabilty instead of dominance for checking value equality in phi 2014-01-03 05:47:03 +00:00
phi-speculation.ll Optimistically analyse Phi cycles 2012-12-10 23:02:41 +00:00
pr18573.ll Test case I forgot to 'add' for r201126. 2014-02-12 03:58:47 +00:00
pure-const-dce.ll Use references to attribute groups on the call/invoke instructions. 2013-02-22 09:09:42 +00:00
store-promote.ll
struct-geps.ll [BasicAA] Try to disambiguate GEPs through arrays of structs into 2015-02-07 17:04:29 +00:00
tailcall-modref.ll FileCheck-ize these tests. Harden some of them. 2012-04-24 09:15:38 +00:00
underlying-value.ll Make DecomposeGEPExpression check SimplifyInstruction only 2011-05-24 18:24:08 +00:00
unreachable-block.ll
zext.ll Revert r219432 - "Revert "[BasicAA] Revert "Revert r218714 - Make better use of zext and sign information.""" 2014-11-13 09:16:54 +00:00