https://gcc.gnu.org/g:1938d9d2bb8ecf84d2aa3c3ef2fb78ec19433057
commit r14-9563-g1938d9d2bb8ecf84d2aa3c3ef2fb78ec19433057 Author: Chenghui Pan <pancheng...@loongson.cn> Date: Fri Mar 15 09:30:26 2024 +0800 LoongArch: Change loongarch_expand_vec_cmp()'s return type from bool to void. This function is always return true at the end of function implementation, so the return value is useless. gcc/ChangeLog: * config/loongarch/lasx.md (vec_cmp<mode><mode256_i>): Remove checking of loongarch_expand_vec_cmp()'s return value. (vec_cmpu<ILASX:mode><mode256_i>): Ditto. * config/loongarch/lsx.md (vec_cmp<mode><mode_i>): Ditto. (vec_cmpu<ILSX:mode><mode_i>): Ditto. * config/loongarch/loongarch-protos.h (loongarch_expand_vec_cmp): Change loongarch_expand_vec_cmp()'s return type from bool to void. * config/loongarch/loongarch.cc (loongarch_expand_vec_cmp): Ditto. Diff: --- gcc/config/loongarch/lasx.md | 6 ++---- gcc/config/loongarch/loongarch-protos.h | 2 +- gcc/config/loongarch/loongarch.cc | 3 +-- gcc/config/loongarch/lsx.md | 6 ++---- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/gcc/config/loongarch/lasx.md b/gcc/config/loongarch/lasx.md index 3f25c0c1756..2fa5e46c8e8 100644 --- a/gcc/config/loongarch/lasx.md +++ b/gcc/config/loongarch/lasx.md @@ -1378,8 +1378,7 @@ (match_operand:LASX 3 "register_operand")]))] "ISA_HAS_LASX" { - bool ok = loongarch_expand_vec_cmp (operands); - gcc_assert (ok); + loongarch_expand_vec_cmp (operands); DONE; }) @@ -1390,8 +1389,7 @@ (match_operand:ILASX 3 "register_operand")]))] "ISA_HAS_LASX" { - bool ok = loongarch_expand_vec_cmp (operands); - gcc_assert (ok); + loongarch_expand_vec_cmp (operands); DONE; }) diff --git a/gcc/config/loongarch/loongarch-protos.h b/gcc/config/loongarch/loongarch-protos.h index 871544f760c..e3ed2b912a5 100644 --- a/gcc/config/loongarch/loongarch-protos.h +++ b/gcc/config/loongarch/loongarch-protos.h @@ -95,7 +95,7 @@ extern void loongarch_split_lsx_fill_d (rtx, rtx); extern const char *loongarch_output_move (rtx, rtx); #ifdef RTX_CODE extern void loongarch_expand_scc (rtx *); -extern bool loongarch_expand_vec_cmp (rtx *); +extern void loongarch_expand_vec_cmp (rtx *); extern void loongarch_expand_conditional_branch (rtx *); extern void loongarch_expand_conditional_move (rtx *); extern void loongarch_expand_conditional_trap (rtx); diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc index 570e9aebad1..f11cf149bbf 100644 --- a/gcc/config/loongarch/loongarch.cc +++ b/gcc/config/loongarch/loongarch.cc @@ -10807,13 +10807,12 @@ loongarch_expand_vec_cond_mask_expr (machine_mode mode, machine_mode vimode, } /* Expand integer vector comparison */ -bool +void loongarch_expand_vec_cmp (rtx operands[]) { rtx_code code = GET_CODE (operands[1]); loongarch_expand_lsx_cmp (operands[0], code, operands[2], operands[3]); - return true; } /* Implement TARGET_PROMOTE_FUNCTION_MODE. */ diff --git a/gcc/config/loongarch/lsx.md b/gcc/config/loongarch/lsx.md index b9b94b9079c..87d3e7c5d9f 100644 --- a/gcc/config/loongarch/lsx.md +++ b/gcc/config/loongarch/lsx.md @@ -518,8 +518,7 @@ (match_operand:LSX 3 "register_operand")]))] "ISA_HAS_LSX" { - bool ok = loongarch_expand_vec_cmp (operands); - gcc_assert (ok); + loongarch_expand_vec_cmp (operands); DONE; }) @@ -530,8 +529,7 @@ (match_operand:ILSX 3 "register_operand")]))] "ISA_HAS_LSX" { - bool ok = loongarch_expand_vec_cmp (operands); - gcc_assert (ok); + loongarch_expand_vec_cmp (operands); DONE; })