This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: SLP reduction: why there is only loop-aware SLP and no straight line?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]