[Bug tree-optimization/116142] vec_widen_smult_{odd,even}_M ineffective for a simple widening dot product (vect_used_by_reduction is not set?)

xry111 at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jul 31 01:21:18 GMT 2024


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

--- Comment #2 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> To make it used by the reduction you'd need to have a dot_product covering
> the accumulation as well.

I can add that, but what if we slightly alter it to something like

short x[8], y[8];

int dot() {
        int ret = 0;
        for (int i = 0; i < 8; i++)
                ret ^= x[i] * y[i];
        return ret;
}

?  It's no longer a dot product but shouldn't vec_widen_smult_{even,odd}_v8hi
be used anyway?


More information about the Gcc-bugs mailing list