[LLVMdev] loop vectorizer and storing to uniform addresses

Frank Winter fwinter at jlab.org
Thu Nov 7 17:18:44 PST 2013


I am trying my luck on this global reduction kernel:

float foo( int start , int end , float * A  )
{
   float sum[4] = {0.,0.,0.,0.};
   for (int i = start ; i < end ; ++i ) {
     for (int q = 0 ; q < 4 ; ++q )
       sum[q] += A[i*4+q];
   }
   return sum[0]+sum[1]+sum[2]+sum[3];
}


LV: Checking a loop in "foo"
LV: Found a loop: for.cond1
LV: Found an induction variable.
LV: We don't allow storing to uniform addresses
LV: Can't vectorize due to memory conflicts
LV: Not vectorizing.


My interpretation would be that the loop vectorizer does not support 
loops which implement a reduction. Is this correct?

Frank





More information about the llvm-dev mailing list