Go to file
Michael Kruse 47f856095a [BasicAA] Use MayAlias instead of PartialAlias for fallback.
Using various methods, BasicAA tries to determine whether two
GetElementPtr memory locations alias when its base pointers are known
to be equal. When none of its heuristics are applicable, it falls back
to PartialAlias to, according to a comment, protect TBAA making a wrong
decision in case of unions and malloc. PartialAlias is not correct,
because a PartialAlias result implies that some, but not all, bytes
overlap which is not necessarily the case here.

AAResults returns the first analysis result that is not MayAlias.
BasicAA is always the first alias analysis. When it returns
PartialAlias, no other analysis is queried to give a more exact result
(which was the intention of returning PartialAlias instead of MayAlias).
For instance, ScopedAA could return a more accurate result.

The PartialAlias hack was introduced in r131781 (and re-applied in
r132632 after some reverts) to fix llvm.org/PR9971 where TBAA returns a
wrong NoAlias result due to a union. A test case for the malloc case
mentioned in the comment was not provided and I don't think it is
affected since it returns an omnipotent char anyway.

Since r303851 (https://reviews.llvm.org/D33328) clang does emit specific
TBAA for unions anymore (but "omnipotent char" instead). Hence, the
PartialAlias workaround is not required anymore.

This patch passes the test-suite and check-llvm/check-clang of a
self-hoisted build on x64.

Reviewed By: hfinkel

Differential Revision: https://reviews.llvm.org/D34318

llvm-svn: 305938
2017-06-21 18:25:37 +00:00
clang Use -NOT prefix instead of adding `not` to FileCheck. 2017-06-21 16:50:38 +00:00
clang-tools-extra [clang-tidy] readability-function-size: fix nesting level calculation 2017-06-16 13:07:47 +00:00
compiler-rt [sanitizer] Add a function to gather random bytes 2017-06-21 15:56:03 +00:00
debuginfo-tests Add a test for PR33166. 2017-05-25 19:33:16 +00:00
libclc generic: add missing get_work_dim include 2017-06-02 15:58:35 +00:00
libcxx [libcxx] [test] Fix -Wmismatched-tags in tuple_size_structured_bindings.pass.cpp. 2017-06-20 21:10:53 +00:00
libcxxabi Use _LIBCPP_FALLTHROUGH() to avoid warnings about [[gnu::fallthrough]] being unsupported 2017-06-15 20:18:10 +00:00
libunwind Change -1LL to -1ULL to silence a gcc warning about left shifting a negative value. Fixes https://bugs.llvm.org/show_bug.cgi?id=33358 2017-06-21 16:02:53 +00:00
lld [PDB] Add symbols to the PDB 2017-06-21 17:25:56 +00:00
lldb Fix a python object leak in SWIG glue. 2017-06-21 01:52:37 +00:00
llgo irgen: Create functions instead of global variables for builtin hash and equal algorithms. 2017-06-04 22:11:28 +00:00
llvm [BasicAA] Use MayAlias instead of PartialAlias for fallback. 2017-06-21 18:25:37 +00:00
openmp Set affinity to none/false in child processes 2017-06-15 21:51:07 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly [ScopInfo] Fix crash with sum of invariant load and AddRec. 2017-06-20 22:53:02 +00:00