public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Peter Bergner <bergner@linux.ibm.com>
Cc: David Edelsohn <dje.gcc@gmail.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] rs6000: Disable optimizing multiple xxsetaccz instructions into one xxsetaccz
Date: Sun, 12 Sep 2021 14:26:34 -0500	[thread overview]
Message-ID: <20210912192634.GF1583@gate.crashing.org> (raw)
In-Reply-To: <8393a33f-50ab-6720-0017-3f012803b990@linux.ibm.com>

Hi!

On Fri, Aug 27, 2021 at 02:58:05PM -0500, Peter Bergner wrote:
> Fwprop will happily optimize two xxsetaccz instructions into one xxsetaccz
> by propagating the results of the first to the uses of the second.
> We really don't want that to happen given the late priming/depriming of
> accumulators.  I fixed this by making the xxsetaccz source operand an
> unspec volatile.

Good good.

> I also removed the mma_xxsetaccz define_expand and
> define_insn_and_split and replaced it with a simple define_insn.

In the future pleaase do that in a separate patch.  That makes it *much*
easier to read and review this.

> GCC10 suffers from the same issue, but since the code is different, I'll
> have to determine a different solution which I'll post as a separate
> patch.

It doesn't currently have an unspec at all, so you cannot give it a
side effect.  It shouldn't be hard to make it use an unspec, just a lot
of mechanics (and testing :-/ )

> 	* config/rs6000/mma.md (unspec): Delete UNSPEC_MMA_XXSETACCZ.
> 	(unspecv): Add UNSPECV_MMA_XXSETACCZ.

Unrelated to this patch, but I have been wondering this for years:
should we have an unspecv enum at all?  It causes some churn, and you
can name the volatile ones UNSPECV_ in either case.

> 	(mma_xxsetaccz): Change to define_insn.  Remove match_operand.
> 	Use UNSPECV_MMA_XXSETACCZ.

It still has the match_operand.

>  ;; We can't have integer constants in XOmode so we wrap this in an UNSPEC.

Does the comment need updating?  It may help to point out here that itr
 needs to be volatile.

>     (set_attr "length" "4")])

Not new of course: the default length is 4, most insns have that, it
helps to be less verbose.

Okay for trunk with that changelog fix.  Thanks!


Segher

  parent reply	other threads:[~2021-09-12 19:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-27 19:58 Peter Bergner
2021-09-12 15:32 ` Bill Schmidt
2021-09-12 19:26 ` Segher Boessenkool [this message]
2021-09-13 22:10   ` Peter Bergner
2021-09-14  0:17     ` Segher Boessenkool
2021-09-14 15:58       ` Peter Bergner

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