summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/misc-inefficient-algorithm.cpp
diff options
context:
space:
mode:
authorAhmed Bougacha <ahmed.bougacha@gmail.com>2015-02-07 17:04:29 +0000
committerAhmed Bougacha <ahmed.bougacha@gmail.com>2015-02-07 17:04:29 +0000
commit29efe3b2874c5192d5618debfdaaa9b89dafb173 (patch)
tree94809f4f52a414c8c8a90c17bb623a942be36b5c /clang-tools-extra/test/clang-tidy/misc-inefficient-algorithm.cpp
parentd7e331e0f9a1173ae320a3829105b54658fef453 (diff)
downloadbcm5719-llvm-29efe3b2874c5192d5618debfdaaa9b89dafb173.tar.gz
bcm5719-llvm-29efe3b2874c5192d5618debfdaaa9b89dafb173.zip
[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 llvm-svn: 228498
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/misc-inefficient-algorithm.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud