public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/50883] [ARM] Suboptimal optimization for small structures
Date: Fri, 04 Feb 2022 11:30:12 +0000	[thread overview]
Message-ID: <bug-50883-4-wcOxlK9RHs@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-50883-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #10)
> (In reply to Richard Earnshaw from comment #9)
> > Part of the problem here is that the gimple expansion does not see the
> > argument unpacking or understand how the parameters are passed; so this is
> > only exposed after lowering to RTL and we are then reliant on the less
> > powerful RTL optimations to get good code.
> 
> Right, i was thinking about how we expose so of it like having a late pass
> which does the splitting if it is possible. This is part of the reason why I
> created the meta bug to record all of these issues in one place to make it
> easier to start working on a pass like that (maybe for gcc 13 but I have so
> much stuff on my plate right now).

Btw, I thought about this issue quite extensively together with Michael Matz
and it's going to be a mess, in particular on the call side.  Representing
things on GIMPLE will also be fun.  The idea for incoming arguments was
to make the "default definitions" explicit.  For aggregates that would mean
having sth like

 struct S { double x; double y; };
 void foo (struct S s)
 {
   register double s$x __asm__("%xmm0");
   register double s$y __asm__("%xmm1");
   <bb2:>
     s.x = s$x;
     s.y = s$y; 
 }

or for registers (ick)

 void foo (_Complex double z)
 {
   register double z$r __asm__("%xmm0");
   register double z$i __asm__("%xmm1");
   <bb2:>
     z_1(D) = COMPLEX_EXPR <z$r, z$i>;
 }

but it's unclear how exactly this will help if it's just done right before
RTL expansion.  It will also be fun when an aggregate is passed partly
on the stack and partly in registers.

A similar approach could work for the return.

For calls we have representational issues, esp. for the return.  Some
cases could be improved but it might also result in for example too
large lifetime of return slots if the expose those.

  parent reply	other threads:[~2022-02-04 11:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-27 11:55 [Bug target/50883] New: " sebastian.huber@embedded-brains.de
2011-10-27 11:56 ` [Bug target/50883] " sebastian.huber@embedded-brains.de
2011-10-27 11:58 ` sebastian.huber@embedded-brains.de
2011-10-27 11:58 ` sebastian.huber@embedded-brains.de
2011-10-27 14:51 ` rguenth at gcc dot gnu.org
2011-10-27 15:20 ` sebastian.huber@embedded-brains.de
2011-10-27 16:53 ` rearnsha at gcc dot gnu.org
2022-02-04  0:50 ` pinskia at gcc dot gnu.org
2022-02-04  0:50 ` pinskia at gcc dot gnu.org
2022-02-04 11:05 ` rearnsha at gcc dot gnu.org
2022-02-04 11:11 ` pinskia at gcc dot gnu.org
2022-02-04 11:30 ` rguenth at gcc dot gnu.org [this message]
2022-02-04 11:45 ` ebotcazou at gcc dot gnu.org
2022-02-04 11:58 ` rguenther at suse dot de
2022-02-04 12:24 ` ebotcazou at gcc dot gnu.org
2022-02-04 12:27 ` rearnsha at gcc dot gnu.org
2022-02-04 12:29 ` rearnsha at gcc dot gnu.org
2022-02-04 12:55 ` ebotcazou at gcc dot gnu.org
2022-02-04 16:29 ` sebastian.huber@embedded-brains.de

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-50883-4-wcOxlK9RHs@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).