This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/64031] New: Vectorization of max/min is not robust enough
- From: "jacques-henri.jourdan at inria dot Fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 23 Nov 2014 12:59:40 +0000
- Subject: [Bug tree-optimization/64031] New: Vectorization of max/min is not robust enough
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64031
Bug ID: 64031
Summary: Vectorization of max/min is not robust enough
Product: gcc
Version: 4.9.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: jacques-henri.jourdan at inria dot Fr
The following code is sucessfully vectorized (using the minps instruction):
const int SIZE = 1<<15;
void test9(float * b)
{
unsigned i;
float *y =__builtin_assume_aligned(b, 16);
for (i = 0; i < SIZE; i++)
{
float f = y[i];
float f2 = f < f*f ? f : f*f;
y[i] = f2;
}
}
But not the following slightly modified version:
void test9(float * b)
{
unsigned i;
float *y =__builtin_assume_aligned(b, 16);
for (i = 0; i < SIZE; i++)
{
float f = y[i];
float f2 = f < f*f ? f : f*f;
y[i] = f2*f2;
}
}
Actually, it seems like vectorization of max/min operations fails as soon as
some computation is done with the result of this min/max operation.