[PATCH] [LAA] Merge memchecks for accesses separated by a constant offset

Adam Nemet anemet at apple.com
Wed Jul 1 11:01:32 PDT 2015


Hi Silviu,

In http://reviews.llvm.org/D10386#197861, @sbaranga wrote:

> The regression happens when executing a code that looks like this:
>
> struct Data{
>
>   int a[LEN];
>   int B[LEN];
>
> };
>
> void test(int m) {
>
>   for (int i = 0; i < m; ++i)
>     Data.a[i + m] = Data.a[i] + Data.b[i];
>
> }
>
> a[i] and b[i] get merged according to the algorithm. However the resulting interval covers a[i + m], and the runtime check fails.


This is the way I look at this problem, please correct me if I am missing something.  We have three pointers all pointing to the same underlying object (Data).  Let's refer to them as P_am, P_a and P_b respectively.

We were able to determine const distance between P_a and P_b however P_am is not constant.  In this case it seems to me that when analyzing P_am, we want to veto the merge of P_a and P_b because as in this case P_am may reside somewhere between the two objects.

This does not seem like a major change to your approach and it does not seem to affect the main use-case.  What do you think?

Adam


http://reviews.llvm.org/D10386

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list