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

--- Comment #6 from Hongtao Liu <liuhongt at gcc dot gnu.org> ---

> thus
> 
>   vect__16.5_40 = MEM <vector(4) short int> [(short int *)a_22(D)];
>   vect__17.6_41 = (vector(4) int) vect__16.5_40;
>   vect__18.9_44 = MEM <vector(4) signed char> [(signed char *)b_23(D)];
>   vect_patt_36.10_45 = (vector(4) signed short) vect__18.9_44;
>   vect_patt_37.11_46 = (vector(4) int) vect_patt_36.10_45;
>   vect__20.12_48 = vect__17.6_41 * vect_patt_37.11_46;
>   _49 = VIEW_CONVERT_EXPR<vector(4) unsigned int>(vect__20.12_48);
>   _50 = .REDUC_PLUS (_49); [tail call]
>   _51 = (int) _50;
> 
>
Ideally, it should be recognized as DOT_PROD_EXPR, but
vect_recog_dot_prod_pattern only works for loop vectorizer. We may add some
pattern match in match.pd for


vect__17.6_41 = (vector(4) int) vect__16.5_40;
vect_patt_37.11_46 = (vector(4) int) vect_patt_36.10_45
vect__20.12_48 = vect__17.6_41 * vect_patt_37.11_46;
_49 = VIEW_CONVERT_EXPR<vector(4) unsigned int>(vect__20.12_48);
_50 = .REDUC_PLUS (_49); [tail call]

to

vect__20.12_48 = DOT_PRDO_EXPR (vect__16.5_40, vect_patt_36.10_45, 0);
_49 = VIEW_CONVERT_EXPR<vector(4) unsigned int>(vect__20.12_48);
_50 = .REDUC_PLUS (_49); [tail call]

Reply via email to