How do I tell GCC there are no pointer aliases for automatic loop vectorization? (The limitation does not work)

I'm having trouble with GCC to vectorize this loop:

register int_fast8_t  __attribute__ ((aligned)) * restrict fillRow = __builtin_assume_aligned(rowMaps + query[i]*rowLen,8);
    register int  __attribute__ ((aligned (16))) *restrict curRow = __builtin_assume_aligned(scoreMatrix + i*rowLen,16), 
         __attribute__ ((aligned (16))) *restrict prevRow = __builtin_assume_aligned(curRow - rowLen,16);
    register unsigned   __attribute__ ((aligned (16))) *restrict shiftCur = __builtin_assume_aligned(shiftMatrix + i*rowLen,16), 
        __attribute__ ((aligned (16))) *restrict shiftPrev = __builtin_assume_aligned(shiftCur - rowLen,16);
    unsigned j; 

    unsigned *restrict  diagShift = shiftPrev - 1;
    int *restrict diagScore = prevRow - 1;
     for (j=1; j < rs; ++j) {
        curRow[j] = diagScore[j] + fillRow[j];
        shiftCur[j] = diagShift[j]; 

    }

      

These variables are taken from two matrices (scoreMatrix and shiftMatrix, which are declared consistent and guaranteed to be aligned on each row), as well as an 8-bit array (fillRow). GCC keeps telling me:

prog.c:600:4: note: === vect_analyze_data_ref_dependences ===
prog.c:600:4: note: versioning for alias required: can't determine dependence between *_90 and *_89
prog.c:600:4: note: mark for run-time aliasing test between *_90 and *_89
prog.c:600:4: note: versioning for alias required: can't determine dependence between *_98 and *_97
prog.c:600:4: note: mark for run-time aliasing test between *_98 and *_97

      

If line 600 is the loop in question. I don't know how to make this more explicit so that there is no overlapping aliases. I used to leave the diagShift and diagScore rows and had the loop index, for example prevRow [j-1] instead of "diagShift [j]" - the exact result. What can I do?

+1
c gcc


source to share


No one has answered this question yet

See similar questions:

3
CCC Vector Extension C: How to move the contents of a vector to the left by one element?

or similar:

2847
Improve SQLite performance per second per second?
1119
How do function pointers work in C?
35
GCC Aliasing Checks w / Bounding Pointers
7
GCC auto-vectorization does not affect runtime, even when supposedly "beneficial"
6
GCC Automatic vectorization of flow control in a loop
3
Why is this vector C loop not auto-incrementing?
2
Array versus automatic pointer vectorization in gcc
2
Why is GCC auto-injection -independent of the type of loop iteration variable?
1
Disable autointegration of specific loops in a function in GCC
0
Does Gcc guarantee that consistent volatile integer access is atomic?



All Articles
Loading...
X
Show
Funny
Dev
Pics