public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: "Li, Pan2" <pan2.li@intel.com>, Robin Dapp <rdapp.gcc@gmail.com>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: "juzhe.zhong@rivai.ai" <juzhe.zhong@rivai.ai>,
	"kito.cheng@gmail.com" <kito.cheng@gmail.com>,
	"richard.guenther@gmail.com" <richard.guenther@gmail.com>,
	"Wang, Yanzhang" <yanzhang.wang@intel.com>,
	"Liu, Hongtao" <hongtao.liu@intel.com>
Subject: Re: [PATCH v2] DSE: Bugfix ICE after allow vector type in get_stored_val
Date: Fri, 22 Mar 2024 12:53:43 -0600	[thread overview]
Message-ID: <2a97fc8b-cb91-46b3-9f72-ec86dbf9ebb1@gmail.com> (raw)
In-Reply-To: <MW5PR11MB590839DB9D67260340FF17A9A9222@MW5PR11MB5908.namprd11.prod.outlook.com>



On 3/4/24 11:22 PM, Li, Pan2 wrote:
> Thanks Jeff for comments.
> 
>> But in the case of a vector modes, we can usually reinterpret the
>> underlying bits in whatever mode we want and do any of the usual
>> operations on those bits.
> 
> Yes, I think that is why we can allow vector mode in get_stored_val if my understanding is correct.
> And then the different modes will return by gen_low_part. Unfortunately, there are some modes
>   (less than a vector bit size like V2SF, V2QI for vlen=128) are considered as invalid by validate_subreg,
> and return NULL_RTX result in the final ICE.
That doesn't make a lot of sense to me.  Even for vlen=128 I would have 
expected that we can still use a subreg to access low bits.  After all 
we might have had a V16QI vector and done a reduction of some sort 
storing the result in the first element and we have to be able to 
extract that result and move it around.

I'm not real keen on a target workaround.  While extremely safe, I 
wouldn't be surprised if other ports could trigger the ICE and we'd end 
up patching up multiple targets for what is, IMHO, a more generic issue.

As Richi noted using validate_subreg here isn't great.  Does it work to 
factor out this code from extract_low_bits:


>   if (!int_mode_for_mode (src_mode).exists (&src_int_mode)
>       || !int_mode_for_mode (mode).exists (&int_mode))
>     return NULL_RTX;
> 
>   if (!targetm.modes_tieable_p (src_int_mode, src_mode))
>     return NULL_RTX;
>   if (!targetm.modes_tieable_p (int_mode, mode))
>     return NULL_RTX;

And use that in the condition (and in extract_low_bits rather than 
duplicating the code)?

jeff

ps.  No need to apologize for the pings.  This completely fell off my radar.

  parent reply	other threads:[~2024-03-22 18:53 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-26  3:25 [PATCH v1] RTL: Bugfix ICE after allow vector type in DSE pan2.li
2024-02-26  3:41 ` Hongtao Liu
2024-02-26  3:42   ` Li, Pan2
2024-02-26  5:13     ` Hongtao Liu
2024-02-26  7:38 ` Richard Biener
2024-02-26  7:41   ` Li, Pan2
2024-02-26 14:22 ` [PATCH v2] DSE: Bugfix ICE after allow vector type in get_stored_val pan2.li
2024-02-27  9:47   ` Richard Biener
2024-02-27 15:02   ` Jeff Law
2024-02-28  1:40     ` Li, Pan2
2024-02-28  4:51       ` Li, Pan2
2024-02-28 17:33         ` Jeff Law
2024-02-29  1:38           ` Li, Pan2
2024-02-29 13:28             ` Robin Dapp
2024-03-02  1:04               ` Li, Pan2
2024-03-03 22:46               ` Jeff Law
2024-03-05  6:22                 ` Li, Pan2
2024-03-12  2:08                   ` Li, Pan2
2024-03-22  1:15                     ` Li, Pan2
2024-03-22 18:53                   ` Jeff Law [this message]
2024-03-23  5:45                     ` Li, Pan2
2024-04-06 12:02                       ` Li, Pan2
2024-04-18  1:46                         ` Li, Pan2
2024-04-28 12:10                           ` Li, Pan2
2024-04-29 15:20                       ` Jeff Law
2024-04-30  1:02                         ` Li, Pan2
2024-04-30  7:17 ` [PATCH v3] DSE: Fix " pan2.li
2024-04-30 11:35   ` Li, Pan2
2024-05-03  1:57     ` Li, Pan2
2024-05-03  1:51 ` [PATCH v4] " pan2.li
2024-05-16  4:06   ` Li, Pan2
2024-05-19 16:23   ` Jeff Law
2024-05-20  1:08     ` Li, Pan2

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=2a97fc8b-cb91-46b3-9f72-ec86dbf9ebb1@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hongtao.liu@intel.com \
    --cc=juzhe.zhong@rivai.ai \
    --cc=kito.cheng@gmail.com \
    --cc=pan2.li@intel.com \
    --cc=rdapp.gcc@gmail.com \
    --cc=richard.guenther@gmail.com \
    --cc=yanzhang.wang@intel.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).