This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/43423] gcc should vectorize this loop through "iteration range splitting"



------- Comment #4 from pinskia at gcc dot gnu dot org  2010-03-18 18:38 -------
(In reply to comment #3)
> Subject: Re:  gcc should vectorize this loop 
>         through "iteration range splitting"
> You mean that the problem is the if-conversion of the stores
> "a[i] = ..."

If we rewrite the code like:
int a[100], b[100], c[100];

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

--- CUT ---
This gets vectorized as we produce an if-cvt first.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |missed-optimization
   Last reconfirmed|0000-00-00 00:00:00         |2010-03-18 18:38:42
               date|                            |


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]