[LLVMdev] [RFC] Scoped no-alias metadata

Krzysztof Parzyszek kparzysz at codeaurora.org
Mon Dec 3 06:29:00 PST 2012


On 12/2/2012 11:21 PM, Daniel Berlin wrote:
>
> "During each execution of B, let L be any lvalue that has &L based on
> P. If L is used to
> access the value of the object X that it designates, and X is also
> modified (by any means),then the following requirements apply:
> ...
> If these requirements are not met, then the behavior is undefined
> "
> (Note the last clause, requiring a modification for the requirements to apply).
>
> So you can come up with arbitrarily complex aliased restrict pointers
> and scopes, all of which share values,and as long as you don't modify
> any of the objects, it's all okay.
> Worse, none of the scoping requirements around restrict lifetimes
> apply *unless* you modify the objects, since those are inside the
> "..." part above.

If the object isn't modified, then none of this matters.  Nobody cares 
about aliasing between loads.  What all this means is that is P is a 
restrict pointer that points to X, then no stores can modify X, unless 
they use addresses based on P.  In other words, loads/stores to 
locations based on P can be aliased with each other, but not with any 
other loads or stores.  This implies that we need grouping of loads and 
stores to properly isolate those based on P from all the others. 
Attaching information to loads and stores individually may not be 
sufficient.

-Krzysztof


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation



More information about the llvm-dev mailing list