public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mark Mitchell <mark@codesourcery.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Richard Guenther <richard.guenther@gmail.com>,
	 Jie Zhang <jie@codesourcery.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [RFC] Don't completely scalarize a record if it contains bit-field (PR tree-optimization/45144)
Date: Fri, 30 Jul 2010 18:53:00 -0000	[thread overview]
Message-ID: <4C531DE2.8070101@codesourcery.com> (raw)
In-Reply-To: <20100730175333.GW18378@tyan-ft48-01.lab.bos.redhat.com>

Jakub Jelinek wrote:
> On Fri, Jul 30, 2010 at 10:11:42AM -0700, Mark Mitchell wrote:
>> To me, Jie's change seems like a plausible heuristic within the current
>> infrastructure.  I'm all for building new infrastructure when
>> possible/necessary, but I don't think we should prevent these kinds of
>> tweaks to heuristics just because we can think of another way of doing
>> things.  To me, the question ought to be "does this make the compiler
>> better for users?"
> 
> I wouldn't call it tweak to heuristics, it looks to me like an ugly hack.

Well, call it what you like.  It's making a guess about when SRA is or
isn't profitable.  It might be a good guess or a bad guess, but it's a
guess, which is why I used the term "heuristic".

> In many cases the SRA of bitfields is very desirable, especially for apps
> that use bitfields heavily like Linux kernel.  I remember Alex spending
> quite some time improving SRA to handle bitfields more efficiently,
> and this hack just disables it altogether.

That's precisely why I wanted some data about that.  Maybe we already
know enough to know that this isn't a good heuristic because we already
know that SRA on bitfields is a big win in lots of cases.  That's fine;
in that case, the patch is not a good thing.

> What we IMHO need is a pass late in the gimple pipeline which will
> optimize adjacent bitfield operations and lower to BIT_FIELD_REF ops
> or something similar, because bitfield ops are too hard to be handled
> efficiently after the expansion.

That's an interesting idea.  Does anyone else have an idea as to the
best plan here?

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

  reply	other threads:[~2010-07-30 18:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-30 16:21 Jie Zhang
2010-07-30 16:37 ` Richard Guenther
2010-07-30 17:27   ` Mark Mitchell
2010-07-30 17:53     ` Jakub Jelinek
2010-07-30 18:53       ` Mark Mitchell [this message]
2010-07-30 18:59         ` Richard Kenner
2010-07-30 19:39           ` Andrew Pinski
2010-07-30 19:48             ` Mark Mitchell
2010-08-02  4:10               ` Jie Zhang
2010-07-31  9:48           ` Richard Guenther
2010-07-31  9:48       ` Richard Guenther
2010-08-02 13:25         ` Martin Jambor
2010-08-02  4:01       ` Jie Zhang
2010-08-02  3:28     ` Jie Zhang
2010-08-02 16:52       ` Mark Mitchell
2010-08-03  9:00         ` Richard Guenther
2010-08-03  9:59           ` Jie Zhang
2010-07-31 10:01 ` Richard Guenther
2010-08-02  4:29   ` Jie Zhang
2010-08-02 13:01 ` Martin Jambor
2010-08-04 11:53   ` Jie Zhang
2010-08-04 12:23     ` Richard Guenther
2010-08-04 19:41       ` Martin Jambor
2010-08-05  3:12         ` Jie Zhang

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=4C531DE2.8070101@codesourcery.com \
    --to=mark@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jie@codesourcery.com \
    --cc=richard.guenther@gmail.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).