public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* How to avoid auto-vectorization for this loop (rolls at most 3 times)
@ 2010-09-08 20:55 Fang, Changpeng
       [not found] ` <680044E4997F5343A2C58032DDD099161733F9@ZIPPY.Emea.Arm.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Fang, Changpeng @ 2010-09-08 20:55 UTC (permalink / raw)
  To: gcc


It seems  the auto-vectorizer could not recognize that this loop will roll at most 3 times.
And it will generate quite messy code. 

int a[1024], b[1024]; 
void foo (int n) 
{
  int i;
  for (i = (n/4)*4; i< n; i++)
    a[i] =  a[i] +  b[i];
}

How can we correctly estimate the number of iterations for this case and use this info for the vectorizer?

Thanks,

Changpeng

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-09 23:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-08 20:55 How to avoid auto-vectorization for this loop (rolls at most 3 times) Fang, Changpeng
     [not found] ` <680044E4997F5343A2C58032DDD099161733F9@ZIPPY.Emea.Arm.com>
2010-09-09 23:13   ` Fang, Changpeng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).