[PATCH] Scoped NoAlias Metadata

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

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?

Now, is there a way to define that the values that A[i] and A[j] may 
possibly alias, that B[k] and B[l] may possibly alias, but no A[?], B[?]
pair will alias. Basically, I would like to represent the same 
information as was available in the original C program.

If I add noalias metadata to the loads then A[i] and A[j] would be 
assumed to not alias either. Is this right?


More information about the llvm-commits mailing list