This is a very naive approach to conclude that both accesses to Arr1 in the
loop below access the same memory location.
void foo(unsigned **Arr1) { for (int i = 0; i < 1024; ++i) for(int j = 0; j < 1024; ++j) Arr1[j][i] = Arr1[j][i] 10; }
By using SCEV, we can conclude that both accesses to Arr1 access the
same location in each loop iteration. I am probably missing something,
but this seems to work for loop variant accesses in the same loop.
It would be great if you could have a look and let me know what I am
missing :)
For SPEC2006 and the test-suite with LTO, this triggers in around 1100
cases. It also helps LoopInterchange to interchange a few more loops.