This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: SLP reduction: why there is only loop-aware SLP and no straight line?
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: anton dot youdkevitch at bell-sw dot com
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Tue, 23 Oct 2018 16:12:37 +0200
- Subject: Re: SLP reduction: why there is only loop-aware SLP and no straight line?
- References: <5BCF18BF.7080301@bell-sw.com>
On Tue, Oct 23, 2018 at 2:49 PM Anton Youdkevitch
<anton.youdkevitch@bell-sw.com> wrote:
>
> Looking at the examples for gcc SLP reduction I see
> that the reduction variable is defined outside the
> loop. It's OK to have this as an example, I thought.
> However, looking at the actual implementation I found
> out that this is the ONLY SLP reduction gcc does.
>
> /* Detect SLP reduction of the form:
>
> #a1 = phi <a5, a0>
> a2 = operation (a1)
> a3 = operation (a2)
> a4 = operation (a3)
> a5 = operation (a4)
>
> #a = phi <a5>
>
> PHI is the reduction phi node (#a1 = phi <a5, a0> above)
> FIRST_STMT is the first reduction stmt in the chain
> (a2 = operation (a1)).
>
> Return TRUE if a reduction chain was detected. */
>
> Is there any reasoning behind this other than that
> the loop-aware one is generally more profitable?
The only reasoning is lack of a implementation ...
(read: time).
IIRC I tried to support the case of vector constructors
as additional sink but even that turned out to be non-trivial
(read: more than a few hours of work)
Richard.
> --
> Thanks,
> Anton