public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Manolis Tsamis <manolis.tsamis@vrull.eu>
To: Jeff Law <jeffreyalaw@gmail.com>
Cc: Hans-Peter Nilsson <hp@bitrange.com>,
	gcc-patches@gcc.gnu.org,
	 Richard Biener <richard.guenther@gmail.com>,
	Philipp Tomsich <philipp.tomsich@vrull.eu>
Subject: Re: [PATCH v2] Implement new RTL optimizations pass: fold-mem-offsets.
Date: Thu, 13 Jul 2023 17:20:25 +0300	[thread overview]
Message-ID: <CAM3yNXpAR387RKY67Fs2E8Zjfmru8Q80x7+7Cisd5mJyN6Gh0Q@mail.gmail.com> (raw)
In-Reply-To: <52abca97-9102-5b2f-3b7b-2f55e10306b5@gmail.com>

On Wed, Jul 12, 2023 at 5:14 PM Jeff Law <jeffreyalaw@gmail.com> wrote:
>
>
>
> On 7/12/23 03:12, Manolis Tsamis wrote:
> > On Mon, Jul 10, 2023 at 12:58 AM Hans-Peter Nilsson <hp@bitrange.com> wrote:
> >>
> >> On Sun, 9 Jul 2023, Hans-Peter Nilsson wrote:
> >>
> >>> On Thu, 15 Jun 2023, Manolis Tsamis wrote:
> >>>
> >>>> This is a new RTL pass that tries to optimize memory offset calculations
> >>>> by moving them from add immediate instructions to the memory loads/stores.
> >>
> >>> It punts on all "use" insns that are not SET.
> >>> Why not use single_set there too?
> >>
> >> Also, I don't see insn costs considered?
> >> (Also: typo "immidiate".)
> >>
> >
> > The only change that this pass does is to change offsets where
> > possible and then simplify add immediate instructions to register
> > moves.
> > I don't see how this could result in worse performance and by
> > extension I don't see where insn costs could be used.
> > Do you have any thoughts about where to use the costs?
> If the offset crosses an architectural size boundary such that the
> instruction was longer, but still valid, it could affect the cost.
>
Ok, I haven't thought about that. I will try a prototype in case we
want to include it in a next iteration of this.

> That's the most obvious case to me.  There may be others.
>
> Any progress on that m68k issue?  I've also got a report of x264 failing
> to build on riscv64 with the V2 variant, but I haven't distilled that
> down to a testcase yet.
>
I have sent a V3 which contains a number of fixes and improvements:
https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624439.html
I tested the new version rebased on master and the m68k issue did not reproduce.
I don't know what exactly fixed it; do we need to know why or is it
enough that the issue is gone following some general fixes?
It is highly possible that this also fixes the x264 failure. Please
let me know if the issue persists with v3 once you're able to test.

Manolis

> jeff

  reply	other threads:[~2023-07-13 14:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15 17:28 Manolis Tsamis
2023-06-17 18:31 ` Jeff Law
2023-07-09 21:37 ` Hans-Peter Nilsson
2023-07-09 21:58   ` Hans-Peter Nilsson
2023-07-12  9:12     ` Manolis Tsamis
2023-07-12 14:13       ` Jeff Law
2023-07-13 14:20         ` Manolis Tsamis [this message]
2023-07-13 16:57           ` Jeff Law
2023-07-12  9:08   ` Manolis Tsamis

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=CAM3yNXpAR387RKY67Fs2E8Zjfmru8Q80x7+7Cisd5mJyN6Gh0Q@mail.gmail.com \
    --to=manolis.tsamis@vrull.eu \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hp@bitrange.com \
    --cc=jeffreyalaw@gmail.com \
    --cc=philipp.tomsich@vrull.eu \
    --cc=richard.guenther@gmail.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).