https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118727
--- Comment #10 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
The difference from AArch64 and LoongArch64 is AArch64 has WIDEN_ABD, and (with
GCC 14.2):
t.c:10:17: note: abd pattern recognized: patt_29 = (int) patt_30;
t.c:10:17: note: extra pattern stmt: patt_30 = .VEC_WIDEN_ABD (a.0_4, b.1_6);
t.c:10:17: note: vect_is_simple_use: operand ABS_EXPR <c_17>, type of def:
internal
t.c:10:17: note: vect_is_simple_use: operand .VEC_WIDEN_ABD (a.0_4, b.1_6),
type of def: internal
t.c:10:17: note: vect_is_simple_use: operand ABS_EXPR <c_17>, type of def:
internal
t.c:10:17: note: vect_is_simple_use: operand .VEC_WIDEN_ABD (a.0_4, b.1_6),
type of def: internal
t.c:10:17: note: vect_recog_sad_pattern: detected: r_18 = _8 + r_23;
t.c:10:17: note: sad pattern recognized: patt_28 = SAD_EXPR <a.0_4, b.1_6,
r_23>;
So a different code path is used:
if (gimple_call_internal_fn (abd_stmt) == IFN_ABD)
{
==> if (!vect_look_through_possible_promotion (vinfo, abd_oprnd0, <==
LoongArch code path
&unprom[0])
|| !vect_look_through_possible_promotion (vinfo, abd_oprnd1,
&unprom[1]))
return NULL;
}
else if (gimple_call_internal_fn (abd_stmt) == IFN_VEC_WIDEN_ABD)
{
==> unprom[0].op = abd_oprnd0; <== AArch64 code
path (already fixed in PR108692)
unprom[0].type = TREE_TYPE (abd_oprnd0);
unprom[1].op = abd_oprnd1;
unprom[1].type = TREE_TYPE (abd_oprnd1);
}
else
return NULL;