[Bug c/21212] New: missed vectorization opportunity
hurbain at cri dot ensmp dot fr
gcc-bugzilla@gcc.gnu.org
Mon Apr 25 13:04:00 GMT 2005
The frontend translates this function:
void test_loop_c(char a[16], char b[16], char c[16])
{
int i;
for(i = 0; i<16; i++)
{
c[i] = a[i] + b[i];
}
}
to
{
int i;
int i;
i = 0;
goto <D2143>;
<D2142>:;
*(c + (char *) (unsigned int) i) = (char) ((signed char) *(a + (char *)
(unsigned int) i) + (signed char) *(b + (char *) (unsigned int) i));
i++ ;
<D2143>:;
if (i <= 15) goto <D2142>; else goto <D2144>;
<D2144>:;
}
and therefore misses an opportunity for vectorization (e.g. paddb from SSE2)
because the table is accessed by pointers and the dependance analysis does not
work in the loop.
Note that GCC vectorizes the same code, with a, b and c defined as global
variables as expected.
--
Summary: missed vectorization opportunity
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hurbain at cri dot ensmp dot fr
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21212
More information about the Gcc-bugs
mailing list