public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Diego Novillo <dnovillo@redhat.com>
To: "Timothy J. Wood" <tjw@omnigroup.com>
Cc: "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Re: [tree-ssa] RFC: Dropping INDIRECT_REF variables
Date: Wed, 14 May 2003 16:06:00 -0000	[thread overview]
Message-ID: <1052928382.8234.25.camel@frodo.toronto.redhat.com> (raw)
In-Reply-To: <2D0876A9-8621-11D7-93E7-000A9567A046@omnigroup.com>

On Wed, 2003-05-14 at 11:31, Timothy J. Wood wrote:
> On Wednesday, May 14, 2003, at 08:09  AM, Diego Novillo wrote:
> > - We disable the ability to treat non-aliased pointer
> >   dereferences as if they were variables.  We would lose the
> >   ability to do some optimizations like:
> 
>    Please forgive me if I'm way off base here, but one example on PPC 
> that your code snippet reminded me of was int->float conversion.
>
Actually, it's my fault.  I wasn't clear enough.  My proposal is to drop
support on the base framework, only.  INDIRECT_REFs would need to be
supported by other passes like SSAPRE.


> void convert(int *input, float *output, unsigned int count)
> {
>      while (count--)
>          *output++ = *input++;
> }
> 
>    both words of the double on the stack are written on each loop even 
> though the one 32-bit portion is always the same.  This store should be 
> hoisted outside the loop (in the degenerate case above this can by a 
> pretty big performance win).  I don't have a 3.3 compiler right now, 
> but on Mac OS X 10.2 (3.1-based):
> 
Well, we never get to this level of detail on trees.  The code you quote
above is not optimizable at the tree level:

foo (input, output, count)
{
  int T.1;
  float T.2;

  while (1)
    {
      count = count - 1;
      if (count == 0ffffffff)
        {
          goto <ULe70>;
        };
      T.1 = *input;
      T.2 = (float)T.1;
      input = input + 4B;
      *output = T.2;
      output = output + 4B
    };
  <ULe70>:;
}

There's nothing in that loop that could be hoisted out.  If we knew the
value of 'count' we could probably unroll the loop, but that's about it.

It's important to note that there are many details that are not exposed
in the tree IL.  Essentially, if you have a target specific optimization
problem, you won't be able to fix it at the tree level.  The
optimizations we do on the trees help indirectly, of course.


Diego.

  reply	other threads:[~2003-05-14 16:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-14 15:09 Diego Novillo
2003-05-14 15:31 ` Timothy J. Wood
2003-05-14 16:06   ` Diego Novillo [this message]
2003-05-14 16:55   ` Dale Johannesen
2003-05-14 16:58     ` David Edelsohn
2003-05-19 20:24     ` tm_gccmail
2003-05-14 16:01 ` Daniel Berlin
2003-05-14 16:11   ` Diego Novillo
2003-05-14 16:16 ` Andrew MacLeod
2003-05-14 16:24   ` Daniel Berlin

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=1052928382.8234.25.camel@frodo.toronto.redhat.com \
    --to=dnovillo@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=tjw@omnigroup.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).