public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: Paolo Bonzini <bonzini@gnu.org>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: PING: PR/17236, improve long long multiply on x86 (middle-end)
Date: Wed, 05 Mar 2008 15:40:00 -0000	[thread overview]
Message-ID: <m3abldxjs0.fsf@localhost.localdomain> (raw)
In-Reply-To: <47BBDFFE.5030001@gnu.org>

Paolo Bonzini <bonzini@gnu.org> writes:

> http://gcc.gnu.org/ml/gcc-patches/2007-12/msg00995.html
> 
> 2007-12-20  Paolo Bonzini  <bonzini@gnu.org>
> 
> 	* combine.c (simplify_set): Try to canonicalize SETS with
> 	swap_commutative_operands_with_target.
> 	* optabs.c (swap_commutative_operands_with_target): Move...
> 	* rtlanal.c (swap_commutative_operands_with_target): ... here.
> 	* rtl.h (swap_commutative_operands_with_target): Add prototype.

This part of the patch is OK.


> 	* regclass.c (record_reg_classes): Favor the class of the destination
> 	operand if the source dies in this instruction.

I don't see anything here which prevent pp->cost[classes[j]] from
going negative.  This patch is OK if you add a check that the value is
greater than zero before you decrement it.


> 	* local-alloc.c (QTY_CMP_PRI): Bump priority of registers with a
> 	small suggested class.

You need to update the comments.  And if you read the comments, you
will see that the current formula is also used in global.c, in
allocno_compare.  Actually the two formulas are very close but not
quite identical; for some reason they differ in how they handle the
size of the pseudo.

This change is going to give a big bump to registers whose preferred
class has only one or two registers, such as the HI/LO registers on
MIPS.  It's hard to know whether the effect will be beneficial.

What happens if you only use size of register class as a tie-breaker
for quantities which are otherwise equal?

In general I can see the advantage to allocating registers in smaller
register classes first, especially when there is an overlap between
classes.  But I'm not yet convinced that this is the best way to do
so.

Thanks.

Ian

  parent reply	other threads:[~2008-03-05 15:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-20  8:55 Paolo Bonzini
2008-02-21 16:00 ` Richard Guenther
2008-02-21 16:54   ` Paolo Bonzini
2008-03-05 15:40 ` Ian Lance Taylor [this message]
2008-03-06  8:29   ` Paolo Bonzini
2008-03-06 17:19     ` Ian Lance Taylor
2008-03-06 17:49       ` Paolo Bonzini
2008-03-07  0:53         ` Ian Lance Taylor
2008-03-07  8:31           ` Paolo Bonzini

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=m3abldxjs0.fsf@localhost.localdomain \
    --to=iant@google.com \
    --cc=bonzini@gnu.org \
    --cc=gcc-patches@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).