[LLVMdev] TBAA: Propagating aliasing information to derived pointers

Johan Tibell johan.tibell at gmail.com
Mon Jan 30 17:49:09 PST 2012


On Wed, Jan 18, 2012 at 6:22 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
> On Wed, Jan 18, 2012 at 6:13 PM, Johan Tibell <johan.tibell at gmail.com> wrote:
>> While adding support for TBAA to GHC's LLVM backend, we ran into the
>> following issue: given a pointer that we know has certain aliasing
>> properties (e.g. it points to the stack, not the heap) we'd like to
>>
>>  * annotate all loads and stores to that pointer with a TBAA type "stack", and
>>  * also annotate all loads and stores to pointers derived from that
>> pointer as "stack".
>>
>> For example, given Sp, which is the GHC stack pointer, and this pseudo-code
>>
>>    tmp = Sp + 4
>>    tmp2 = load tmp  // should be marked as "stack"
>>
>> we'd like to not only annotate loads/stores to Sp as "stack" but also
>> all loads/stores to tmp.
>>
>> Is this something that can be achieved within the current framework or
>> should we propagate the pointer aliasing information ourselves?
>
> 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?

Cheers,
Johan




More information about the llvm-dev mailing list