public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: "Vineet Gupta" <vineetg@rivosinc.com>,
	"Christoph Müllner" <christoph.muellner@vrull.eu>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Patrick O'Neill <patrick@rivosinc.com>
Subject: Re: xthead regression with [COMMITTED] RISC-V: const: hide mvconst splitter from IRA
Date: Mon, 9 Oct 2023 14:45:59 -0600	[thread overview]
Message-ID: <4b7bd14f-76bd-45b7-9c3f-8ac2806eaed7@gmail.com> (raw)
In-Reply-To: <4e2c5f07-f52e-4362-874f-907b17b9c766@rivosinc.com>



On 10/9/23 14:36, Vineet Gupta wrote:
> Hi Christoph,
> 
> On 10/9/23 12:06, Patrick O'Neill wrote:
>>
>> Hi Vineet,
>>
>> We're seeing a regression on all riscv targets after this patch:|
>>
>> FAIL: gcc.target/riscv/xtheadcondmov-indirect.c -O2 
>> check-function-bodies ConNmv_imm_imm_reg||
>> FAIL: gcc.target/riscv/xtheadcondmov-indirect.c -O3 -g 
>> check-function-bodies ConNmv_imm_imm_reg
>>
>> Debug log output:
>> body: \taddi    a[0-9]+,a[0-9]+,-1000+
>> \tli    a[0-9]+,9998336+
>> \taddi    a[0-9]+,a[0-9]+,1664+
>> \tth.mveqz    a[0-9]+,a[0-9]+,a[0-9]+
>> \tret
>>
>> against:     li    a5,9998336
>>     addi    a4,a0,-1000
>>     addi    a0,a5,1664
>>     th.mveqz    a0,a1,a4
>>     ret|
>>
>> https://github.com/patrick-rivos/gcc-postcommit-ci/issues/8
>> https://github.com/ewlu/riscv-gnu-toolchain/issues/286
>>
> 
> It seems with my patch, exactly same instructions get out of order (for 
> -O2/-O3) tripping up the test results and differ from say O1 for exact 
> same build.
> 
> -O2 w/ patch
> ConNmv_imm_imm_reg:
>      li    a5,9998336
>      addi    a4,a0,-1000
>      addi    a0,a5,1664
>      th.mveqz    a0,a1,a4
>      ret
> 
> -O1 w/ patch
> ConNmv_imm_imm_reg:
>      addi    a4,a0,-1000
>      li    a5,9998336
>      addi    a0,a5,1664
>      th.mveqz    a0,a1,a4
>      ret
> 
> I'm not sure if there is an easy way to handle that.
> Is there a real reason for testing the full sequences verbatim, or is 
> testing number of occurrences of th.mv{eqz,nez} enough.
> It seems Jeff recently added -fno-sched-pressure to avoid similar issues 
> but that apparently is no longer sufficient.
I'd suggest doing a count test rather than an exact match.

Verify you get a single li, two addis and one th.mveqz

Jeff

  reply	other threads:[~2023-10-09 20:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06 18:22 Vineet Gupta
     [not found] ` <ea5d682f-d483-7f57-f27a-882d473026e2@rivosinc.com>
2023-10-09 20:36   ` xthead regression with " Vineet Gupta
2023-10-09 20:45     ` Jeff Law [this message]
2023-10-09 20:46     ` Christoph Müllner
2023-10-09 20:48       ` Vineet Gupta
2023-10-09 22:48         ` Christoph Müllner

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=4b7bd14f-76bd-45b7-9c3f-8ac2806eaed7@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=christoph.muellner@vrull.eu \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=patrick@rivosinc.com \
    --cc=vineetg@rivosinc.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).