While VMAT_STRIDED_SLP supports also effective elementwise accesses in the case of load permutes we still suffer from PR65518. There should be a way to improve the situation here, either by element-wise accesses honorig the permute or by unpermuted loads and permutes of the now sparse vectors.
I will look at this for next stage1.
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:1f6b1ed047105103c2fba9696fd0ed17ec5e1405 commit r16-4076-g1f6b1ed047105103c2fba9696fd0ed17ec5e1405 Author: Richard Biener <rguenther@suse.de> Date: Wed Sep 24 12:19:17 2025 +0200 tree-optimization/116816 - improve VMAT_ELEMENTWISE with SLP The following implements VMAT_ELEMENTWISE for grouped loads, in particular for being able to serve as fallback for unhandled load permutations since it's trivial to load elements in the correct order. PR tree-optimization/116816 * tree-vect-stmts.cc (get_load_store_type): Allow multi-lane single-element interleaving to fall back to VMAT_ELEMENTWISE. Fall back to VMAT_ELEMENTWISE when we cannot handle a load permutation. (vectorizable_load): Do not check a load permutation for VMAT_ELEMENTWISE. Handle grouped loads with VMAT_ELEMENTWISE and directly apply a load permutation.
This is now implemented. VMAT_ELEMENTWISE loads can handle all permutations and any number of SLP lanes.