[LLVMdev] Dependence Analysis [was: Flow-Sensitive AA]

matthieu at illinois.edu matthieu at illinois.edu
Fri Aug 22 07:41:47 PDT 2008




>However, there is one issue I have ignored - possibility of overflow in
>the index expression. Suppose, we have such a loop:
>  for (i8 i = 0; i != 200; ++i) {
>    A[2 * i + 5] = ...
>    ... = A[2 * i + 3]
>  }
>If both index expressions are evaluated in 8-bit arithmetic,
>then the dependence equation should be solved in modular arithmetic:
>  2 * i + 5 == 2 * (i + delta) + 3 (mod 256)
>So the dependence distance is delta == 1 or delta == -127 what gives
>two direction vectors: (<), (>). My version will produce only the first
>one. Taking into account overflow issue during dependence analysis seems
>very difficult to me. Does anybody have some experience in this area?
>Fortunately, programmers generally do not write programs in such a
>nasty way.

I asked myself the same question. Without mod, how do you ensure that for instance the expression 2*i+255 was not actually 2*i-1 ?





More information about the llvm-dev mailing list