Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am trying simple matrix addition code to get auto vectorized.

float A[100];
float A[100];
float C[100];

int n = 6;

  for (int i=0; i<n; i++)
    for (int j=0; j<n; j++)
        C[i*n+j] = A[i*n+j] + B[i*n+j];

I am getting following remarks after using Rpass analysis flag for the above code :

the cost-model indicates that vectorization is not beneficial [-Rpass-missed=loop-vectorize]

the cost-model indicates that interleaving is not beneficial [-Rpass-missed=loop-vectorize]

loop not vectorized: the optimizer was unable to perform the requested transformation; the 
transformation might be disabled or specified as part of an unsupported transformation ordering

what changes should I do to make it vectorized and what does this remarks mean ?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.9k views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...