public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Pat Haugen <pthaugen@linux.ibm.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	"Kewen.Lin" <linkw@linux.ibm.com>,
	David Edelsohn <dje.gcc@gmail.com>,
	Peter Bergner <bergner@linux.ibm.com>
Subject: Re: [PATCH V2, rs6000] Tweak modulo define_insns to eliminate register copy
Date: Tue, 21 Mar 2023 13:21:06 -0500	[thread overview]
Message-ID: <20230321182106.GI25951@gate.crashing.org> (raw)
In-Reply-To: <0e1a14ae-a16a-5af7-82be-c868d792d00d@linux.ibm.com>

Hi!

On Tue, Mar 21, 2023 at 07:10:04AM -0500, Pat Haugen wrote:
> Updated patch with review comments addressed: fixed up testcase and added
> another testcase to verify peephole is functional.
> 
> Don't force target of modulo into a distinct register.
> 
> The define_insns for the modulo operation currently force the target 
> register
> to a distinct reg in preparation for a possible future peephole combining
> div/mod. But this can lead to cases of a needless copy being inserted. Fixed
> with the following patch.

> +/* { dg-final { scan-assembler-not {\mmodsd\M} } } */
> +/* { dg-final { scan-assembler-not {\mmodud\M} } } */

You can do
  /* { dg-final { scan-assembler-not {\mmod[su]d\M} } } */
if you want?

With or without that, okay for trunk.  Thanks!


Segher

      reply	other threads:[~2023-03-21 18:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21 12:10 Pat Haugen
2023-03-21 18:21 ` Segher Boessenkool [this message]

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=20230321182106.GI25951@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=bergner@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=linkw@linux.ibm.com \
    --cc=pthaugen@linux.ibm.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).