public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/43423]  New: gcc should vectorize this loop through "iteration range splitting"
@ 2010-03-18 18:01 changpeng dot fang at amd dot com
  2010-04-08 17:47 ` [Bug tree-optimization/43423] gcc should vectorize this loop through if-conversion spop at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: changpeng dot fang at amd dot com @ 2010-03-18 18:01 UTC (permalink / raw)
  To: gcc-bugs

chfang@pathscale:~/gcc$ cat foo.c
int a[100], b[100], c[100];

void foo(int n, int mid)
{
  int i;
  for(i=0; i<n; i++)
    {
      if (i < mid)
        a[i] = a[i] + b[i];
      else
        a[i] = a[i] + c[i];
    }
}


chfang@pathscale:~/gcc$ gcc -O3 -ftree-vectorizer-verbose=7 -c foo.c

foo.c:6: note: not vectorized: control flow in loop.
foo.c:3: note: vectorized 0 loops in function.

This loop can be vectorized by icc.

For this case, I would expect to see two loops with iteration range
of [0, mid) and [mid, n). Then both loops can be vectorized.

I am not sure which pass in gcc should do this iteration range splitting.


-- 
           Summary: gcc should vectorize this loop through "iteration range
                    splitting"
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: changpeng dot fang at amd dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43423


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

end of thread, other threads:[~2021-09-14  6:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-43423-4@http.gcc.gnu.org/bugzilla/>
2021-07-20  2:47 ` [Bug tree-optimization/43423] gcc should vectorize this loop through if-conversion pinskia at gcc dot gnu.org
2021-09-14  6:34 ` pinskia at gcc dot gnu.org
2010-03-18 18:01 [Bug c/43423] New: gcc should vectorize this loop through "iteration range splitting" changpeng dot fang at amd dot com
2010-04-08 17:47 ` [Bug tree-optimization/43423] gcc should vectorize this loop through if-conversion spop at gcc dot gnu dot org
2010-05-07 21:41 ` changpeng dot fang at amd dot com
2010-05-24 22:44 ` spop at gcc dot gnu dot org
2010-05-24 22:47 ` changpeng dot fang at amd dot com
2010-05-24 23:02 ` spop at gcc dot gnu dot org
2010-05-25 23:33 ` spop at gcc dot gnu dot org

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).