public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: "Kewen.Lin" <linkw@linux.ibm.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Peter Bergner <bergner@linux.ibm.com>,
	Michael Meissner <meissner@linux.ibm.com>,
	David Edelsohn <dje.gcc@gmail.com>
Subject: Re: [PATCH] rs6000: Fix some issues related to Power10 fusion [PR104024]
Date: Thu, 22 Dec 2022 12:53:20 -0600	[thread overview]
Message-ID: <20221222185320.GX25951@gate.crashing.org> (raw)
In-Reply-To: <87345a42-055d-a104-bf43-7721e4b3bc9f@linux.ibm.com>

On Wed, Dec 21, 2022 at 11:41:58AM +0800, Kewen.Lin wrote:
> on 2022/12/20 21:19, Segher Boessenkool wrote:
> > Sure, I understand that.  What I don't like is the generator program is
> > much too big and unstructured already, and this doesn't help at all; it
> > makes it quite a bit worse even.

> >> Good point, and I just noticed that we should check tune setting instead
> >> of TARGET_POWER10 here?  Something like:
> >>
> >> if (!(rs6000_isa_flags_explicit & OPTION_MASK_P10_FUSION))
> >>   {
> >>     if (processor_target_table[tune_index].processor == PROCESSOR_POWER10)
> >>       rs6000_isa_flags |= OPTION_MASK_P10_FUSION;
> >>     else
> >>       rs6000_isa_flags &= ~OPTION_MASK_P10_FUSION;
> >>   }
> > 
> > Yeah that looks better :-)
> 
> I'm going to test this and commit it first.  :)

Thanks!

> > Maybe you can restructure the Perl code a bit in a first patch, and then
> > add the insn condition?  If you're not comfortable with Perl, I'll deal
> > with it, just update the patch.
> 
> OK, I'll give it a try, TBH I just fixed the place for insn condition, didn't
> look into this script, with a quick look, I'm going to factor out the main
> body from the multiple level loop, do you have some suggestions on which other
> candidates to be restructured?

Anything that makes the code easier to understand, basically.

This stuff is by nature pretty hard to read, but making the code shorter
and/or less nested should make it easier to understand.  You will need
to have fewer local variables per function than there are total now,
that will help.

Btw, this script isn't so big at all, but the patches are hard to review
without converting this to a side-by-side comparison first.  There must
be some way to improve that, that is what I'm looking for :-)


Segher

  reply	other threads:[~2022-12-22 18:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30  8:30 Kewen.Lin
2022-12-14 11:25 ` PING^1 " Kewen.Lin
2022-12-14 22:29 ` Segher Boessenkool
2022-12-19  6:13   ` Kewen.Lin
2022-12-20 13:19     ` Segher Boessenkool
2022-12-21  3:41       ` Kewen.Lin
2022-12-22 18:53         ` Segher Boessenkool [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-02-22  2:47 Kewen.Lin

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=20221222185320.GX25951@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=meissner@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).