[LLVMdev] TBAA: Propagating aliasing information to derived pointers

Dan Gohman gohman at apple.com
Tue Jan 31 11:34:59 PST 2012


On Jan 30, 2012, at 5:49 PM, Johan Tibell wrote:

> On Wed, Jan 18, 2012 at 6:22 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
>> 
>> In the current TBAA implementation, the marking only applies to the
>> given load; it doesn't give any special properties to the loaded
>> pointer.
> 
> Is there a particular reason the current implementation doesn't do it
> (i.e. is it unsafe in general?) or is it just that no one has gotten
> around to implementing it?

It's unsafe in general. For example, this is valid:

void *v = whatever;
int *p = v;
float *q = v;

int **x = &p;
float **y = &q;

Here, *x and *y refer to distinct memory, but **x and **y refer
to the same memory.

Dan




More information about the llvm-dev mailing list