https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98138

--- Comment #22 from Zhongyao Chen <chenzhongyao.hit at gmail dot com> ---
(In reply to Zhongyao Chen from comment #21)
> Created attachment 63661 [details]
> some_experiment log

Hi Richard,

I noticed that current SLP vectorization groups statements by operator. For
interleaved computation patterns (e.g., Hadamard-like transforms), this leads
to:
1. Redundant computations due to stmt duplication
2. Extra VEC_PERM_EXPR nodes

https://godbolt.org/z/Mjj6f41MP

Test case and SLP tree dumps attached. See trunk_slp_tree.log for the current
tree structure.

I wonder if we can detect such patterns and keep single-lane nodes instead of
operator-based grouping?

The my_personal_expected_slp_tree.log shows my local experiment with lane
permutation { 0[0] 1[0] 2[0] 3[0] } and single-lane children. This would of
course need additional changes to support, such as perm lowering.

What you think?

Reply via email to