public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Aaron Sawdey <acsawdey@linux.ibm.com>
Cc: gcc <gcc@gcc.gnu.org>,
	Segher Boessenkool <segher@kernel.crashing.org>,
	 Bill Schmidt <wschmidt@linux.ibm.com>
Subject: Re: Add ops_num to targetm.sched.reassociation_width hook
Date: Wed, 4 Aug 2021 11:54:55 +0200	[thread overview]
Message-ID: <CAFiYyc24wCX_KR0NmF4HhkT8raZod9MVQ_itzjKFfNBL3GKGzQ@mail.gmail.com> (raw)
In-Reply-To: <AF316060-8043-48E8-BAD2-46039E4C8846@linux.ibm.com>

On Wed, Aug 4, 2021 at 2:07 AM Aaron Sawdey <acsawdey@linux.ibm.com> wrote:
>
> Richard,
>
> So, I’m noticing that in get_reassociation_width() we know how many ops (ops_num) are in the expression being considered for parallel reassociation, but this is not passed to the target hook. In my testing this seems like it might be useful to have. If you determine the maximum width that gives additional speedup for a large number of terms, and then use that as the width from the target hook, get_reassociation_width() is more aggressive than you would like for small expressions with maybe 4-16 terms and produces code that is slower than optimal. For example in many cases you want to continue using a width of 1 until you get to 16 terms or so. My testing shows this to be the case for power8, power9, and power10 processors.
>
> So, I’m wondering how it might be received if I posted a patch that adds this to the reassociation_width target hook (and of course fixes all uses of that target hook)?

You probably saw that get_reassociation_width already tries to
optimize things.  So what exactly
would you change and why is it slower for 4-16 terms but not for 17+
ones?  I suppose "is slower"
is --param mining on some benchmarks on your side and eventually you
manage to pick the
best threshold to not run into register pressure issues (by luck) for
those benchmarks?

That said, I question you can explain why it is slower, right?

Richard.

> Thanks!
>    Aaron
>
>
> Aaron Sawdey, Ph.D. sawdey@linux.ibm.com
> IBM Linux on POWER Toolchain
>
>

      reply	other threads:[~2021-08-04  9:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-04  0:07 Aaron Sawdey
2021-08-04  9:54 ` Richard Biener [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=CAFiYyc24wCX_KR0NmF4HhkT8raZod9MVQ_itzjKFfNBL3GKGzQ@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=acsawdey@linux.ibm.com \
    --cc=gcc@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    --cc=wschmidt@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).