public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeffrey A Law <law@cygnus.com>
To: Toon Moene <toon@moene.indiv.nluug.nl>
Cc: Jim Wilson <wilson@cygnus.com>, egcs@cygnus.com
Subject: Re: my EGCS status (really Fortran patches)
Date: Wed, 22 Oct 1997 22:33:00 -0000	[thread overview]
Message-ID: <5627.877584924@hurl.cygnus.com> (raw)
In-Reply-To: <9710211752.AA19479@moene.indiv.nluug.nl>

  In message <9710211752.AA19479@moene.indiv.nluug.nl>you write:
  > >  The simplify_giv_expr change makes sense.  I haven't
  > >  tried building a PA compiler to see why it sometimes
  > >  gives worse code.
  > 
  > I must confess that I only tested code with perfectly nested loops  
  > (i.e. no code in the outer loop, like above).  I don't know if that  
  > would make a difference.
For reference, I believe part of the problem is loop doesn't
recognize that some of the more complex expressions that the
new USE patch recognizes as GIVS are related.

Given the example fortran code in my last message, we find the
following in the .loop file:

Reg 101: biv verified
Reg 96: biv verified
Biv 101 initialized at insn 272: initial value (reg:SI 102)
Biv 96 initialized at insn 24: initial value (reg/v:SI 97)
Insn 38: giv reg 105 src reg 96 benefit 2 used 1 lifetime 1 replaceable mult 1 add -1
Insn 42: giv reg 107 src reg 96 benefit 4 used 1 lifetime 13 replaceable mult 8 add -8
Insn 51: giv reg 113 src reg 96 benefit 6 used 1 lifetime 23 replaceable mult 8 add (plus:SI (reg:SI 112)
    (const_int -8))
Insn 52: giv reg 114 src reg 96 benefit 8 used 1 lifetime 19 replaceable mult 8 add (plus:SI (reg:SI 103)
    (plus:SI (reg:SI 112)
        (const_int -8)))
Insn 86: giv reg 138 src reg 96 benefit 8 used 1 lifetime 6 replaceable mult 8 add (plus:SI (reg:SI 127)
    (plus:SI (reg:SI 112)
        (const_int -8)))
Insn 101: giv reg 148 src reg 96 benefit 6 used 1 lifetime 16 replaceable mult 8 add (plus:SI (reg:SI 147)
    (const_int -8))
Insn 102: giv reg 149 src reg 96 benefit 8 used 1 lifetime 2 replaceable mult 8 add (plus:SI (reg:SI 103)
    (plus:SI (reg:SI 147)
        (const_int -8)))
Insn 104: dest address src reg 96 benefit 9 used 1 lifetime 1 replaceable mult 8 add (plus:SI (plus:SI (reg:SI 112)
        (const_int -8))
    (reg:SI 127))
Insn 106: dest address src reg 96 benefit 9 used 1 lifetime 1 replaceable mult 8 add (plus:SI (plus:SI (reg:SI 147)
        (const_int -8))
    (reg:SI 103))
Insn 109: dest address src reg 96 benefit 9 used 1 lifetime 1 replaceable mult 8 add (plus:SI (plus:SI (reg:SI 112)
        (const_int -8))
    (reg:SI 103))
Insn 127: giv reg 166 src reg 96 benefit 8 used 1 lifetime 1 replaceable mult 8 add (plus:SI (reg:SI 155)
    (plus:SI (reg:SI 112)
        (const_int -8)))
Insn 129: dest address src reg 96 benefit 9 used 1 lifetime 1 replaceable mult 8 add (plus:SI (plus:SI (reg:SI 112)
        (const_int -8))
    (reg:SI 155))
Insn 132: dest address src reg 96 benefit 9 used 1 lifetime 1 replaceable mult 8 add (plus:SI (plus:SI (reg:SI 112)
        (const_int -8))
    (reg:SI 103))
Insn 150: giv reg 180 src reg 96 benefit 8 used 1 lifetime 7 replaceable mult 8 add (plus:SI (reg:SI 169)
    (plus:SI (reg:SI 112)
        (const_int -8)))
Insn 200: giv reg 215 src reg 96 benefit 8 used 1 lifetime 1 replaceable mult 8 add (plus:SI (reg:SI 169)
    (plus:SI (reg:SI 147)
        (const_int -8)))
Insn 204: dest address src reg 96 benefit 9 used 1 lifetime 1 replaceable mult 8 add (plus:SI (plus:SI (reg:SI 147)
        (const_int -8))
    (reg:SI 169))
Insn 207: dest address src reg 96 benefit 9 used 1 lifetime 1 replaceable mult 8 add (plus:SI (plus:SI (reg:SI 112)
        (const_int -8))
    (reg:SI 169))
Insn 230: dest address src reg 96 benefit 9 used 1 lifetime 1 replaceable mult 8 add (plus:SI (plus:SI (reg:SI 112)
        (const_int -8))
    (reg:SI 169))
Loop unrolling: Initial value not constant.
Cannot eliminate biv 101.
First use: insn 26, last use: insn 31.
biv 96 can be eliminated.
giv at 207 combined with giv at 230
giv at 109 combined with giv at 132
giv of insn 38 not worth while, 0 vs 42.
giv at 230 reduced to (reg:SI 246)
giv at 207 reduced to (reg:SI 246)
giv at 204 reduced to (reg:SI 251)
giv at 200 reduced to (reg:SI 256)
giv at 150 reduced to (reg:SI 261)
giv at 132 reduced to (reg:SI 266)
giv at 129 reduced to (reg:SI 271)
giv at 127 reduced to (reg:SI 276)
giv at 109 reduced to (reg:SI 266)
giv at 106 reduced to (reg:SI 281)
giv at 104 reduced to (reg:SI 286)
giv at 102 reduced to (reg:SI 291)
giv at 101 reduced to (reg:SI 296)
giv at 86 reduced to (reg:SI 300)
giv at 52 reduced to (reg:SI 305)
giv at 51 reduced to (reg:SI 310)
giv at 42 reduced to (reg:SI 314)


So, we see that all the givs share the same biv & mult_val.

May share partial expressions in add_val, but the add_val as a whole
generally isn't the same for each giv -- for example:


Insn 230: dest address src reg 96 benefit 9 used 1 lifetime 1 replaceable mult 8 add (plus:SI (plus:SI (reg:SI 112)
        (const_int -8))
    (reg:SI 169))

Insn 204: dest address src reg 96 benefit 9 used 1 lifetime 1 replaceable mult 8 add (plus:SI (plus:SI (reg:SI 147)
        (const_int -8))
    (reg:SI 169))



jeff

  parent reply	other threads:[~1997-10-22 22:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <9710211752.AA19479@moene.indiv.nluug.nl>
1997-10-22 21:33 ` Jeffrey A Law
1997-10-22 22:55   ` Toon Moene
1997-10-22 23:26     ` Jeffrey A Law
1997-10-23  0:47     ` Jeffrey A Law
1997-10-23 10:45       ` Toon Moene
1997-10-23 11:04         ` Jeffrey A Law
1997-10-23 12:18           ` Joe Buck
1997-10-24 22:37     ` -frerun-loop Jeffrey A Law
1997-10-22 22:33 ` Jeffrey A Law [this message]
1997-10-26  9:18 ` my EGCS status (really Fortran patches) Jeffrey A Law
1997-10-27 16:30   ` Jim Wilson
1997-10-27 15:54     ` Jeffrey A Law
1997-10-27 17:21       ` Jim Wilson
1997-10-28 12:35         ` Jeffrey A Law
1997-10-28 12:35           ` Toon Moene

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=5627.877584924@hurl.cygnus.com \
    --to=law@cygnus.com \
    --cc=egcs@cygnus.com \
    --cc=toon@moene.indiv.nluug.nl \
    --cc=wilson@cygnus.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).