On Wed, Oct 28, 2026 at 12:13 PM Robin Dapp <[email protected]> wrote:
>
> > I wonder if we can deal with this case during RTL expansion, basically
> > detect a concat permute and see if there's vec_init of vector components
> > supported and use that? The alternative to new patterns would be to
> > make vec_perm_const of the target emit a concat?
> >
> > Or did I misunderstand the issue?
>
> Ugh, I had a follow-up for this sitting locally for almost half a
> year... I didn't find a good fix in expand and would always need to
> introduce new target patterns. So what I did is restrict the
> optimization to vectors with >= 2 lanes. The rest of the code is
> unchanged except for rebasing.
>
> Going to post it separately so Sashiko can pick it up (it doesn't scan
> threads yet AFAICT).
_1 = BIT_FIELD_REF <src1_9(D), 32, 0>;
_2 = BIT_FIELD_REF <src1_9(D), 32, 32>;
_3 = BIT_FIELD_REF <src1_9(D), 32, 64>;
_4 = BIT_FIELD_REF <src1_9(D), 32, 96>;
_5 = BIT_FIELD_REF <src2_16(D), 32, 0>;
_6 = BIT_FIELD_REF <src2_16(D), 32, 32>;
_7 = BIT_FIELD_REF <src2_16(D), 32, 64>;
_8 = BIT_FIELD_REF <src2_16(D), 32, 96>;
_21 = {_1, _2, _3, _4, _5, _6, _7, _8};
so going back to the original mail - for the above, why not
create
_21 = { src1_9(D), src2_16(D) };
? I'm not seeing context (loop vect? BB vect?), so if this
is for BB vectorization the vector CTOR root handling
could simply split at SLP discovery time, handling
multiple (sub-)vectors (I think it does that already), and
for interleaved elements create a VEC_PERM SLP node.
The new matches[] representation should get you two
isomorphic groups so a good idea how to lay out the
split.
Richard.
> Regards
> Robin