Go to file
Michael Kuperstein 82069c44ca [BasicAA] Improve precision of alloca vs. inbounds GEP alias queries
If a we have (a) a GEP and (b) a pointer based on an alloca, and the
beginning of the object the GEP points would have a negative offset with
repsect to the alloca, then the GEP can not alias pointer (b).

For example, consider code like:

struct { int f0, int f1, ...} foo;
...
foo alloca;
foo *random = bar(alloca);
int *f0 = &alloca.f0
int *f1 = &random->f1;

Which is lowered, approximately, to:
%alloca = alloca %struct.foo
%random = call %struct.foo* @random(%struct.foo* %alloca)
%f0 = getelementptr inbounds %struct, %struct.foo* %alloca, i32 0, i32 0
%f1 = getelementptr inbounds %struct, %struct.foo* %random, i32 0, i32 1

Assume %f1 and %f0 alias. Then %f1 would point into the object allocated
by %alloca. Since the %f1 GEP is inbounds, that means %random must also
point into the same object. But since %f0 points to the beginning of %alloca,
the highest %f1 can be is (%alloca + 3). This means %random can not be higher
than (%alloca - 1), and so is not inbounds, a contradiction.

Differential Revision: http://reviews.llvm.org/D20495

llvm-svn: 270777
2016-05-25 22:23:08 +00:00
clang [CGDebugInfo] Modify the preferred expression location for member calls. 2016-05-25 22:08:27 +00:00
clang-tools-extra Speed up check by using a recursive visitor. 2016-05-25 16:19:23 +00:00
compiler-rt [profile] Add early checking to bypass node pointer update 2016-05-25 21:27:02 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc math: Use single precision fmax in sp path 2016-05-17 19:44:01 +00:00
libcxx [libcxx] Allow explicit pthread opt-in 2016-05-25 17:40:09 +00:00
libcxxabi Allow explicit pthread opt-in 2016-05-25 17:37:38 +00:00
libunwind Introduce a native-only unwinder build. 2016-05-25 12:36:34 +00:00
lld [ELF] - Added support for jmp/call relaxations when R_X86_64_GOTPCRELX/R_X86_64_REX_GOTPCRELX are used. 2016-05-25 16:51:08 +00:00
lldb Add logging to ValueObjectSyntheticFilter such that one can trace through the creation of synthetic children 2016-05-25 21:38:32 +00:00
llgo [llgo] llgoi: separate evaluation from printing 2016-04-25 01:18:20 +00:00
llvm [BasicAA] Improve precision of alloca vs. inbounds GEP alias queries 2016-05-25 22:23:08 +00:00
openmp D20525: Use more general function for getting gtid which may be faster than specific one. 2016-05-25 12:53:17 +00:00
polly [ScopInfo] Remove unused typedef OutgoingValueMapTy. NFC. 2016-05-23 14:51:52 +00:00