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

--- Comment #18 from Hongtao.liu <crazylht at gmail dot com> ---
(In reply to Jakub Jelinek from comment #16)
> Created attachment 54590 [details]
> gcc13-pr109011-2.patch
> 
> Here is what I have right now, totally untested and will need further work
> so that the two pattern recognizers work together nicely (I think the one
> modified by the earlier patch will for ctz/ffs need to trigger first and
> allow
> ctz/ffs and be done even if for these they don't have direct optab but have
> ctz (for ffs), clz or popcount.  And then let the new one rewrite it.

For ffs/ctz generated by vect_recog_popcount_clz_ctz_ffs_pattern, we can call
vect_recog_ctz_ffs_pattern again with a little adjustment so that call_stmt
doesn't come from stmt_vinfo->stmt but from parameter.

Reply via email to