https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117093
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2024-10-12 Ever confirmed|0 |1 --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- Indeed. This probably best fits the bswap pass which could be enhanced to discover vector permutes. There are some match.pd patterns doing that for very simple cases: /* Simplify vector inserts of other vector extracts to a permute. */ (simplify (bit_insert @0 (BIT_FIELD_REF@2 @1 @rsize @rpos) @ipos) but here it doesn't work out greedily (also bit_insert into vec_perm folding is missing). I think attacking this from bswap is better (but the pass only runs late).