This is the mail archive of the
mailing list for the GCC project.
Re: [RFC] Don't completely scalarize a record if it contains bit-field (PR tree-optimization/45144)
- From: Jie Zhang <jie at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Mark Mitchell <mark at codesourcery dot com>, Richard Guenther <richard dot guenther at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 02 Aug 2010 12:01:03 +0800
- Subject: Re: [RFC] Don't completely scalarize a record if it contains bit-field (PR tree-optimization/45144)
- References: <4C52F946.firstname.lastname@example.org> <AANLkTimbiUfL5EmxEczuo6jhLroLvFpY78tgU1Gx3JJy@mail.gmail.com> <4C5307CE.email@example.com> <20100730175333.GW18378@tyan-ft48-01.lab.bos.redhat.com>
On 07/31/2010 01:53 AM, Jakub Jelinek wrote:
On Fri, Jul 30, 2010 at 10:11:42AM -0700, Mark Mitchell wrote:
My patch does not disable SRA of bit-fields. It's an adjust of the tweak
for PR 42585. It's only disable total scalarization of small records
containing bit-fields. As you said below, it's difficult for RTL
combiner to combine the scalarized bit-fields again. So we'd better to
avoid total scalarizing it. If the bit-fields are accessed explicitly in
the IL, SRA still works as in usual way.
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.
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.
As my reply to Mark's email, my patch does not change the final assembly
of linux kernel, at least for 126.96.36.199 with the default configuration of