[PATCH] [Polly][PoC] Approximate the parameters when creating runtime alias checks.

Tobias Grosser tobias at grosser.es
Wed Sep 24 06:55:52 PDT 2014


Hi Johannes,

thanks for your proof of concept.

It seems you left out the code generation support, such that after this patch the test cases start to crash. This is probably intentional, but I would like to note this to avoid misunderstandings.

Regarding the patch, there are two questions that need to be checked:

### 1) Is it correct?

For the following code:

```
void foo(float *A, float *B, long N, long p1) {                                  
        for (long i = 0; i < 100; i++)                                           
                B[i] = A[i - p1];                                                
} 
```

I get the following exception:

isl/isl_tab_pip.c:491: unbounded optimum

Introducing a single new parameter that is smaller or larger than all parameters does not work in case you have negative coefficients for certain parameters.

### 2) What do we loose with this over-approximation?

Do you know what kind of simple cases we would now refuse? Are those exceptional cases or pretty common ones?


My feeling is that we might loose some rather basic cases. To fix this, we could possibly try to detect them and then use this approximation. However, maybe just detecting the possibly complicated cases and blindly bailing out would already good enough for now.

I remember you recently used isl_set_involves_dims() in the "[Polly] Find all loops involved in now innermost ones." patch. Maybe we can use this one here to count the number of parameter dimensions involved in a certain access set and bail out if more than X parameters are involved?

http://reviews.llvm.org/D5441






More information about the llvm-commits mailing list