[llvm-dev] Alias semantic

Alexandre Isoard via llvm-dev llvm-dev at lists.llvm.org
Thu Mar 9 11:39:41 PST 2017


Hello fellow LLVM developers,

I was wondering about the semantic of aliasing.
Here are some examples where I am not sure if the two stores aliases:

Example 1:

for (int i = 2; i < n; ++i) {
  store A[i];
  store A[i-2];
}

Example 2:

for (int i = 2; i < n; ++i)
  store A[i];
for (int i = 2; i < n; ++i)
  store A[i-2];

In the example 1, they do not alias in a single iteration, but they do
alias at some point if n > 4.
That is, there is an execution path from one instance of the store to an
instance of the other store such that they access the same memory cell.

In example 2 it is easier to see the difference.

I am somewhat in the fog here.

Best regard.

-- 
*Alexandre Isoard*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170309/cea1d6a4/attachment.html>


More information about the llvm-dev mailing list