[llvm-commits] SIV tests in LoopDependence Analysis, Sanjoy's patch

Sanjoy Das sanjoy at playingwithpointers.com
Fri Mar 16 11:13:19 PDT 2012


Hi Preston, Hal,

I do have commit access, but I don't think the work is ready for
merging.  It does feel good to get positive feedback, of course. :)

The issue is, the dependence analysis does not calculate direction
vectors.  And, without direction vectors, it isn't possible to combine
analysis of separate subscripts (in a multi-dimensional array) into an
analysis of the array access as a whole.

For instance, the access in the loop

for (i = 0; i < N; i++)
  for (j = 0; j < N; j++)
    array[i + 1][j - 1] = array[i][j] + C

is (according to the code I wrote) dependent on the first subscript
but independent on the second, which is plain wrong since that way the
entire access works out to be independent.

I don't think individual subscript analysis should even return a
Independent / Dependent result.  Instead, it should return a subset of
{ <, =, >, Provably independent, Unknown }.  That way, the dependence
direction in the above loop comes out to be [<, >] (and hence
dependent).  Breaking conditions also need to be worked in and all
this needs to be public since loop transformations will need this
information.

I'm already working towards this, and will probably have to change the
interface LDA exposes.  Hopefully I will have some code ready by this
weekend.

This is the first time I'm working on a analysis pass proper, and I
really don't want to commit half-baked code. :) Meanwhile, I'll push
my work here: https://github.com/sanjoy/llvm/tree/lda

Thanks!
-- 
Sanjoy Das.
http://playingwithpointers.com



More information about the llvm-commits mailing list