This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/43423] gcc should vectorize this loop through "iteration range splitting"
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Mar 2010 18:38:42 -0000
- Subject: [Bug tree-optimization/43423] gcc should vectorize this loop through "iteration range splitting"
- References: <bug-43423-18740@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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