public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "manolis.tsamis at vrull dot eu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/114010] Unwanted effects of using SSA free lists.
Date: Fri, 23 Feb 2024 15:02:58 +0000	[thread overview]
Message-ID: <bug-114010-4-e0qpCjaDja@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114010-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114010

--- Comment #10 from Manolis Tsamis <manolis.tsamis at vrull dot eu> ---
(In reply to ptomsich from comment #9)
> (In reply to Manolis Tsamis from comment #0) 
> > E.g. another loop, non canonicalized names:
> > 
> > .L120:
> > 	ldr	q30, [x0], 16
> > 	movi	v29.2s, 0
> > 	ld2	{v26.16b - v27.16b}, [x4], 32
> > 	movi	v25.4s, 0
> > 	zip1	v29.16b, v30.16b, v29.16b
> > 	zip2	v30.16b, v30.16b, v25.16b
> > 	umlal	v29.8h, v26.8b, v28.8b
> > 	umlal2	v30.8h, v26.16b, v28.16b
> > 	uaddw	v31.4s, v31.4s, v29.4h
> > 	uaddw2	v31.4s, v31.4s, v29.8h
> > 	uaddw	v31.4s, v31.4s, v30.4h
> > 	uaddw2	v31.4s, v31.4s, v30.8h
> > 	cmp	x5, x0
> > 	bne	.L120
> 
> Is it just me, or are the zip1 and zip2 instructions dead?
> 
> Philipp.

They certainly look dead, but they're not because the umlal/umlal2 (and other
accumulate instructions) also read from the destination register.

There looks to be a missed optimization opportunity to use just a single `movi
v25.4s, 0` here though.

Also, looking again at the generated code in the first example:

        mov     v23.16b, v18.16b
        mla     v23.16b, v17.16b, v25.16b

If I'm correct this could be folded into just

        mla     v18.16b, v17.16b, v25.16b

In which case most of the movs in the first and second example could be
eliminated. To me it looks like the accumulate instructions are missing some
optimizations.

      parent reply	other threads:[~2024-02-23 15:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20 10:22 [Bug tree-optimization/114010] New: " manolis.tsamis at vrull dot eu
2024-02-21  0:06 ` [Bug tree-optimization/114010] " pinskia at gcc dot gnu.org
2024-02-21  0:11 ` pinskia at gcc dot gnu.org
2024-02-21  0:22 ` pinskia at gcc dot gnu.org
2024-02-21 12:03 ` manolis.tsamis at vrull dot eu
2024-02-21 12:09 ` manolis.tsamis at vrull dot eu
2024-02-22  1:02 ` ptomsich at gcc dot gnu.org
2024-02-22  1:02 ` ptomsich at gcc dot gnu.org
2024-02-22 10:28 ` rguenth at gcc dot gnu.org
2024-02-23 14:31 ` ptomsich at gcc dot gnu.org
2024-02-23 15:02 ` manolis.tsamis at vrull dot eu [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=bug-114010-4-e0qpCjaDja@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).