https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118151
Spencer Abson <Spencer.Abson at arm dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |Spencer.Abson at arm dot com --- Comment #3 from Spencer Abson <Spencer.Abson at arm dot com> --- Looks like we'd need patterns for any/none that allow the mode of the predicate produced by the flag-setting operation to differ from that which governs the PTEST. For example, our existing combiner patterns will also not match: #include <arm_sve.h> int foo (svbool_t pg, svint32_t x, svint32_t y) { return svptest_any(pg, svcmpeq(pg, x, y)); } which currently generates: cmpeq p3.s, p0/z, z0.s, z1.s ptest p0, p3.b cset w0, any ret where a test on a VNx4BI is governed by a VNx16BI. It would be incorrect to fold here for first/not-first/last/not-last but, as above, would be fine for any/none given that CMPEQ will zero any bits that VNx4BI disregards. I can investigate more later on, open to more discussion here too.