This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] vectorizing conditional expressions (PR tree-optimization/65947)
- From: Alan Lawrence <alan dot lawrence at arm dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>, Alan Hayward <Alan dot Hayward at arm dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 18 Sep 2015 14:26:37 +0100
- Subject: Re: [PATCH] vectorizing conditional expressions (PR tree-optimization/65947)
- Authentication-results: sourceware.org; auth=none
- References: <D217578B dot 7FE4%alan dot hayward at arm dot com> <CAFiYyc0tYw9p9_z=5at7+2V8r9LzN0iRdA=w6TQ1==ZiqXb0bA at mail dot gmail dot com> <D21DD124 dot 813A%alan dot hayward at arm dot com> <CAFiYyc1gxyLSS3VcHiJtE43DpmxLPpR12tBKKGLhU_pO1hUBwg at mail dot gmail dot com>
On 18/09/15 13:17, Richard Biener wrote:
Ok, I see.
That this case is already vectorized is because it implements MAX_EXPR,
modifying it slightly to
int foo (int *a)
{
int val = 0;
for (int i = 0; i < 1024; ++i)
if (a[i] > val)
val = a[i] + 1;
return val;
}
makes it no longer handled by current code.
Yes. I believe the idea for the patch is to handle arbitrary expressions like
int foo (int *a)
{
int val = 0;
for (int i = 0; i < 1024; ++i)
if (some_expression (i))
val = another_expression (i);
return val;
}
Cheers,
Alan