[PATCH] Scoped NoAlias Metadata

Tobias Grosser tobias at grosser.es
Wed Jul 23 00:06:06 PDT 2014


On 23/07/2014 09:04, Hal Finkel wrote:
> ----- Original Message -----
>> From: "Tobias Grosser" <tobias at grosser.es>
>> To: reviews+D2194+public+a9f2c71a9ad3b374 at reviews.llvm.org, hfinkel at anl.gov, dan433584 at gmail.com, atrick at apple.com,
>> chandlerc at gmail.com
>> Cc: llvm-commits at cs.uiuc.edu
>> Sent: Wednesday, July 23, 2014 2:01:25 AM
>> Subject: Re: [PATCH] Scoped NoAlias Metadata
>>
>> On 20/07/2014 05:47, hfinkel at anl.gov wrote:
>>> +Each type of metadata specifies a list of scopes, and when
>>> evaluating an
>>> +aliasing query, if one of the instructions has a scope in its
>>> ``alias.scope``
>>> +list that is identical to a scope in the other instruction's
>>> ``noalias`` list,
>>> +or is a descendant (in the scope hierarchy) of a scope in the
>>> other
>>> +instruction's ``noalias`` list , then the two memory accesses are
>>> assumed not
>>> +to alias.
>>
>> Hi Hal,
>>
>> one point that did not get immediately clear from the documentation
>> is
>> what happens in such a case.
>>
>> void func(float A[restrict], float B[restrict],
>>             int i, int j, int k, int l) {
>>      A[i] = A[j] = B[k] = B[l];
>> }
>>
>> I assume all four instructions will be in the same alias.scope,
>> right?
>
> No, each restrict pointer will essentially get its own scope. In this way, you can precisely specify what may alias with what.

OK, that works. Would it make sense to add such an example to the 
documentation?

Anyway, thanks for working on this. I think it is extremely useful.

Cheers,
Tobias



More information about the llvm-commits mailing list