public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Lehua Ding" <lehua.ding@rivai.ai>
To: "Richard Sandiford" <richard.sandiford@arm.com>,
	钟居哲 <juzhe.zhong@rivai.ai>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re:Fw: [PATCH V2] RTL_SSA: Relax PHI_MODE in phi_setup
Date: Tue, 18 Jul 2023 11:30:35 +0800	[thread overview]
Message-ID: <tencent_0414A64C1FFE710F033527D0@qq.com> (raw)
In-Reply-To: <tencent_FF8DEC3E3EC2AF63678490BFEAE176593909@qq.com>

[-- Attachment #1: Type: text/plain, Size: 3712 bytes --]

Committed to the trunk, thanks Richard and Juzhe.


1. bootstrap and regression are pass on i386 target (by Pan).
2. no new failed testcases on AArch64 target.


Best,
Lehua


------------------ Original ------------------
From:                                                                                                                        "Richard Sandiford"                                                                                    <gcc-patches@gcc.gnu.org&gt;;
Date:&nbsp;Mon, Jul 17, 2023 10:44 PM
To:&nbsp;"juzhe.zhong"<juzhe.zhong@rivai.ai&gt;;
Cc:&nbsp;"gcc-patches"<gcc-patches@gcc.gnu.org&gt;;
Subject:&nbsp;Re: [PATCH V2] RTL_SSA: Relax PHI_MODE in phi_setup



juzhe.zhong@rivai.ai writes:
&gt; From: Ju-Zhe Zhong <juzhe.zhong@rivai.ai&gt;
&gt;
&gt; Hi, Richard.
&gt;
&gt; RISC-V port needs to add a bunch VLS modes (V16QI,V32QI,V64QI,...etc)
&gt; There are sharing same REG_CLASS with VLA modes (VNx16QI,VNx32QI,...etc)
&gt;
&gt; When I am adding those VLS modes, the RTL_SSA initialization in VSETVL PASS (inserted after RA) ICE:
&gt; rvv.c:13:1: internal compiler error: in partial_subreg_p, at rtl.h:3186
&gt;&nbsp; &nbsp; 13 | }
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; | ^
&gt; 0xf7a5b1 partial_subreg_p(machine_mode, machine_mode)
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; ../../../riscv-gcc/gcc/rtl.h:3186
&gt; 0x1407616 wider_subreg_mode(machine_mode, machine_mode)
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; ../../../riscv-gcc/gcc/rtl.h:3252
&gt; 0x2a2c6ff rtl_ssa::combine_modes(machine_mode, machine_mode)
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; ../../../riscv-gcc/gcc/rtl-ssa/internals.inl:677
&gt; 0x2a2b9a4 rtl_ssa::function_info::simplify_phi_setup(rtl_ssa::phi_info*, rtl_ssa::set_info**, bitmap_head*)
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; ../../../riscv-gcc/gcc/rtl-ssa/functions.cc:146
&gt; 0x2a2c142 rtl_ssa::function_info::simplify_phis()
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; ../../../riscv-gcc/gcc/rtl-ssa/functions.cc:258
&gt; 0x2a2b3f0 rtl_ssa::function_info::function_info(function*)
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; ../../../riscv-gcc/gcc/rtl-ssa/functions.cc:51
&gt; 0x1cebab9 pass_vsetvl::init()
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; ../../../riscv-gcc/gcc/config/riscv/riscv-vsetvl.cc:4578
&gt; 0x1cec150 pass_vsetvl::execute(function*)
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; ../../../riscv-gcc/gcc/config/riscv/riscv-vsetvl.cc:4716
&gt;
&gt; The reason is that we have V32QImode (size = [32,0]) which is the mode set as regno_reg_rtx[97]
&gt; When the PHI input def comes from ENTRY BLOCK (index =0), the def-&gt;mode () = V32QImode.
&gt; But the phi_mode = VNx2QI for example (I use VLA modes intrinsic write the codes).
&gt; Then combine_modes report ICE.
&gt;
&gt; gcc/ChangeLog:
&gt;
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; * rtl-ssa/internals.inl: Fix when mode1 and mode2 are not ordred.

OK if it passes testing.

Thanks,
Richard

&gt; ---
&gt;&nbsp; gcc/rtl-ssa/internals.inl | 3 +++
&gt;&nbsp; 1 file changed, 3 insertions(+)
&gt;
&gt; diff --git a/gcc/rtl-ssa/internals.inl b/gcc/rtl-ssa/internals.inl
&gt; index 0a61811289d..e49297c12b3 100644
&gt; --- a/gcc/rtl-ssa/internals.inl
&gt; +++ b/gcc/rtl-ssa/internals.inl
&gt; @@ -673,6 +673,9 @@ combine_modes (machine_mode mode1, machine_mode mode2)
&gt;&nbsp; &nbsp; if (mode2 == E_BLKmode)
&gt;&nbsp;&nbsp;&nbsp; &nbsp; return mode1;
&gt;&nbsp; 
&gt; +&nbsp; if (!ordered_p (GET_MODE_SIZE (mode1), GET_MODE_SIZE (mode2)))
&gt; +&nbsp; &nbsp; return BLKmode;
&gt; +
&gt;&nbsp; &nbsp; return wider_subreg_mode (mode1, mode2);
&gt;&nbsp; }

           reply	other threads:[~2023-07-18  3:30 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <tencent_FF8DEC3E3EC2AF63678490BFEAE176593909@qq.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_0414A64C1FFE710F033527D0@qq.com \
    --to=lehua.ding@rivai.ai \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=juzhe.zhong@rivai.ai \
    --cc=richard.sandiford@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).