[0/2] LoongArch: Fix PR113033 and clean up code

Message ID 20231219065957.70665-1-xry111@xry111.site
Headers
Series LoongArch: Fix PR113033 and clean up code |

Message

Xi Ruoyao Dec. 19, 2023, 6:59 a.m. UTC
  Superseds
https://gcc.gnu.org/pipermail/gcc-patches/2023-December/640871.html.

Per Jakub's response, vec_init patterns do not have a predicate on the
input operand so the operand can be *anything*.  It's not safe to simply
move it into an reg, and we have to use force_reg instead.

The code clean up is separated into the 2nd patch to make reviewing
easier.

Bootstrapped and regtested on loongarch64-linux-gnu.  Ok for trunk?

Xi Ruoyao (2):
  LoongArch: Use force_reg instead of gen_reg_rtx + emit_move_insn in
    vec_init expander [PR113033]
  LoongArch: Clean up vec_init expander

 gcc/config/loongarch/loongarch.cc             | 54 +++++++------------
 gcc/testsuite/gcc.target/loongarch/pr113033.c | 23 ++++++++
 2 files changed, 43 insertions(+), 34 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/loongarch/pr113033.c
  

Comments

Lulu Cheng Dec. 19, 2023, 7:26 a.m. UTC | #1
We will read and test these patches as soon as possible.

Thanks!

在 2023/12/19 下午2:59, Xi Ruoyao 写道:
> Superseds
> https://gcc.gnu.org/pipermail/gcc-patches/2023-December/640871.html.
>
> Per Jakub's response, vec_init patterns do not have a predicate on the
> input operand so the operand can be *anything*.  It's not safe to simply
> move it into an reg, and we have to use force_reg instead.
>
> The code clean up is separated into the 2nd patch to make reviewing
> easier.
>
> Bootstrapped and regtested on loongarch64-linux-gnu.  Ok for trunk?
>
> Xi Ruoyao (2):
>    LoongArch: Use force_reg instead of gen_reg_rtx + emit_move_insn in
>      vec_init expander [PR113033]
>    LoongArch: Clean up vec_init expander
>
>   gcc/config/loongarch/loongarch.cc             | 54 +++++++------------
>   gcc/testsuite/gcc.target/loongarch/pr113033.c | 23 ++++++++
>   2 files changed, 43 insertions(+), 34 deletions(-)
>   create mode 100644 gcc/testsuite/gcc.target/loongarch/pr113033.c
>
  
Chenghui Pan Dec. 20, 2023, 3:52 a.m. UTC | #2
The patches are look ok and no problem in spec2017 correctness check.

On 2023/12/19 15:26, chenglulu wrote:
> We will read and test these patches as soon as possible.
>
> Thanks!
>
> 在 2023/12/19 下午2:59, Xi Ruoyao 写道:
>> Superseds
>> https://gcc.gnu.org/pipermail/gcc-patches/2023-December/640871.html.
>>
>> Per Jakub's response, vec_init patterns do not have a predicate on the
>> input operand so the operand can be *anything*.  It's not safe to simply
>> move it into an reg, and we have to use force_reg instead.
>>
>> The code clean up is separated into the 2nd patch to make reviewing
>> easier.
>>
>> Bootstrapped and regtested on loongarch64-linux-gnu.  Ok for trunk?
>>
>> Xi Ruoyao (2):
>>    LoongArch: Use force_reg instead of gen_reg_rtx + emit_move_insn in
>>      vec_init expander [PR113033]
>>    LoongArch: Clean up vec_init expander
>>
>>   gcc/config/loongarch/loongarch.cc             | 54 +++++++------------
>>   gcc/testsuite/gcc.target/loongarch/pr113033.c | 23 ++++++++
>>   2 files changed, 43 insertions(+), 34 deletions(-)
>>   create mode 100644 gcc/testsuite/gcc.target/loongarch/pr113033.c
>>