public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: jeevitha <jeevitha@linux.vnet.ibm.com>
To: Peter Bergner <bergner@linux.ibm.com>, "Kewen.Lin" <linkw@linux.ibm.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Segher Boessenkool <segher@kernel.crashing.org>,
	Michael Meissner <meissner@linux.ibm.com>
Subject: Re: [PATCH] rs6000: Don't allow immediate value in the vsx_splat pattern [PR113950]
Date: Mon, 26 Feb 2024 20:42:00 +0530	[thread overview]
Message-ID: <53a6e158-5e4a-47db-8f91-6f0c75830719@linux.vnet.ibm.com> (raw)
In-Reply-To: <97e31ecb-6c99-4302-957c-ac45d106f15d@linux.ibm.com>



On 26/02/24 8:37 pm, Peter Bergner wrote:
> On 2/26/24 4:49 AM, Kewen.Lin wrote:
>> on 2024/2/26 14:18, jeevitha wrote:
>>> Hi All,
>>> diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md
>>> index 6111cc90eb7..e5688ff972a 100644
>>> --- a/gcc/config/rs6000/vsx.md
>>> +++ b/gcc/config/rs6000/vsx.md
>>> @@ -4660,7 +4660,7 @@
>>>  (define_expand "vsx_splat_<mode>"
>>>    [(set (match_operand:VSX_D 0 "vsx_register_operand")
>>>  	(vec_duplicate:VSX_D
>>> -	 (match_operand:<VEC_base> 1 "input_operand")))]
>>> +	 (match_operand:<VEC_base> 1 "splat_input_operand")))]
>>>    "VECTOR_MEM_VSX_P (<MODE>mode)"
>>>  {
>>>    rtx op1 = operands[1];
>>
>> This hunk actually does force_reg already:
>>
>> ...
>>   else if (!REG_P (op1))
>>     op1 = force_reg (<VSX_D:VEC_base>mode, op1);
>>
>> but it's assigning to op1 unexpectedly (an omission IMHO), so just
>> simply fix it with:
>>
>>   else if (!REG_P (op1))
>> -    op1 = force_reg (<VSX_D:VEC_base>mode, op1);
>> +    operands[1] = force_reg (<VSX_D:VEC_base>mode, op1);
> 
> I agree op1 was an oversight and it should be operands[1].
> That said, I think using more precise predicates is a good thing,
> so I think we should use both Jeevitha's predicate change and
> your operands[1] change.
> 
> I'll note that Jeevitha originally had the operands[1] change, but I
> didn't look closely enough at the issue or the pattern and mentioned
> that these kinds of bugs can be caused by too loose constraints and
> predicates, which is when she found the updated predicate to use.
> I believe she already even bootstrapped and regtested the operands[1]
> only change.  Jeevitha???
> 
> 

Yes, Peter. I have already bootstrapped and regtested the operands[1] change.

  reply	other threads:[~2024-02-26 15:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-26  6:18 jeevitha
2024-02-26 10:49 ` Kewen.Lin
2024-02-26 15:07   ` Peter Bergner
2024-02-26 15:12     ` jeevitha [this message]
2024-02-27  1:55     ` Kewen.Lin
2024-02-27  2:13       ` Peter Bergner
2024-02-27  2:56         ` Kewen.Lin
2024-02-27  9:07           ` jeevitha
2024-02-26 20:32 ` [PATCH V2] " jeevitha
2024-02-27 12:40   ` Segher Boessenkool
2024-02-27 22:50     ` Peter Bergner
2024-02-28 14:31       ` Segher Boessenkool
2024-02-28 17:58         ` Peter Bergner
2024-02-28 20:00           ` Segher Boessenkool

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=53a6e158-5e4a-47db-8f91-6f0c75830719@linux.vnet.ibm.com \
    --to=jeevitha@linux.vnet.ibm.com \
    --cc=bergner@linux.ibm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=linkw@linux.ibm.com \
    --cc=meissner@linux.ibm.com \
    --cc=segher@kernel.crashing.org \
    /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).