[Bug tree-optimization/120647] [X86] Sub optimal code generated for counting the number matches between two array elements

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Feb 20 18:57:49 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120647

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Like we have reduc_sbool_{and,ior,xor}_scal optabs we could add a
popcount_sbool
optab for the case vector masks do not have distinct modes like V4BI.  For
integer mode vector masks we could use regular popcount as well.

This still involves quite some special-casing as the accumulator will be
an integer and not a vector of integers.  Possibly multiple integers with
high enough VF.


More information about the Gcc-bugs mailing list