This patch series is a second version of the patch https://gcc.gnu.org/pipermail/gcc-patches/2026-May/716654.html
Richard had the following suggestion to perform the recognition of compress pattern: "We already have code to recognize a scatter with special offset as "strided store" (for RISC-V IIRC), so one option is to go with that approach, keep the scatter but recognize the special offset and use a "compress-scatter" case here?" This is again a prototype patch series to perfrom the above suggestion. Please have a look at it and let us know if we are in the right direction. Please note that we tried to do only the first two phases mentioned in the RFC: https://gcc.gnu.org/pipermail/gcc/2026-May/248167.html Please note that there may be formating issues in the patch, which will be addressed once the approach is finalized. Raghesh Aloor (4): Detect predicated-index PHI and matching IFN_MASK_STORE vectorizer: Move predicated-index PHI detection into tree-vect-vpcompress vectorizer: Add predicated-index and compress-scatter IFNs vectorizer: Wire vpcompress through DR and stmt analysis gcc/Makefile.in | 1 + gcc/internal-fn.cc | 58 ++++ gcc/internal-fn.def | 4 + gcc/tree-vect-data-refs.cc | 14 +- gcc/tree-vect-loop.cc | 20 +- gcc/tree-vect-patterns.cc | 3 + gcc/tree-vect-stmts.cc | 45 ++- gcc/tree-vect-vpcompress.cc | 582 ++++++++++++++++++++++++++++++++++++ gcc/tree-vect-vpcompress.h | 33 ++ gcc/tree-vectorizer.h | 12 + 10 files changed, 767 insertions(+), 5 deletions(-) create mode 100644 gcc/tree-vect-vpcompress.cc create mode 100644 gcc/tree-vect-vpcompress.h -- 2.34.1
