[Bug tree-optimization/97770] [ICELAKE]suboptimal vectorization for vpopcntw/b/q

rguenther at suse dot de gcc-bugzilla@gcc.gnu.org
Thu Jun 10 06:48:46 GMT 2021


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

--- Comment #18 from rguenther at suse dot de <rguenther at suse dot de> ---
On Thu, 10 Jun 2021, crazylht at gmail dot com wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97770
> 
> --- Comment #17 from Hongtao.liu <crazylht at gmail dot com> ---
> (In reply to Richard Biener from comment #16)
> > Changing the signature will not help given we don't want to regress other
> > cases.
> > Instead we have to somehow remove the pro- and demotions with the help of
> > patterns.  I think using .POPCOUNT should work there.
> 
> I'm thinking of reimplementing _mm_popcnt_u64 with a backend builtin like
> __builtin_ia32_popcountll which is defined as ULONGLONG_FTYPE_ULONGLONG, and
> handle that in TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION.

That's going to work I guess but it will pessimize general optimization
which no longer know this is computing popcount (not sure if the old
version exposed that fact).


More information about the Gcc-bugs mailing list