From: Easwaran Raman <eraman@google.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: reply@codereview.appspotmail.com, gcc-patches@gcc.gnu.org
Subject: Re: Propagate profile counts after switch case expansion (issue5896043)
Date: Fri, 23 Mar 2012 22:36:00 -0000 [thread overview]
Message-ID: <CAPK5YPb2CeEf5p3HtvzzmQqjn_sAEOxr0we=q6vd52Cm63zVXg@mail.gmail.com> (raw)
In-Reply-To: <m2ty1fymrb.fsf@firstfloor.org>
On Fri, Mar 23, 2012 at 3:29 PM, Andi Kleen <andi@firstfloor.org> wrote:
> Easwaran Raman <eraman@google.com> writes:
>
>> Some more background on this patch: Right now, while the execution
>> counts of different case labels of a switch statement are obtained
>> during profile collection, they are not propagated to RTL. Instead,
>> counts are regenerated at the RTL level using static heuristics that
>> tend to weigh branches equally which can cause poor optimization of
>> hot code. This patch ensures that the counts collected during profile
>> collection are correctly propagated allowing hot code to be better
>> optimized by RTL optimizations. Patch tested on x86_64.
>
> I think your patch doesn't use the probably to weight the decision
> tree for non tablejump, right? I looked at this some time ago,
> but the patch always had problems.
Do you mean use the weights to decide the shape of the binary tree
(similar to COST_TABLE heuristic)? I am planning to send a separate
patch for that. This one just makes sure that the profile counts are
propagated correctly. So you will still have a situation where a
branch corresponding to an infrequently executed case dominates a
frequently executed case, but the BB of the cases gets the right
profile weight.
- Easwaran
> -Andi
>
> --
> ak@linux.intel.com -- Speaking for myself only
next prev parent reply other threads:[~2012-03-23 22:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-23 17:43 Easwaran Raman
2012-03-23 19:35 ` Easwaran Raman
2012-03-23 22:29 ` Andi Kleen
2012-03-23 22:36 ` Easwaran Raman [this message]
2012-03-23 22:39 ` Andi Kleen
2012-03-25 19:22 ` Jan Hubicka
2012-03-26 4:40 ` Easwaran Raman
2012-04-09 21:33 ` Easwaran Raman
2012-04-16 20:55 ` Easwaran Raman
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='CAPK5YPb2CeEf5p3HtvzzmQqjn_sAEOxr0we=q6vd52Cm63zVXg@mail.gmail.com' \
--to=eraman@google.com \
--cc=andi@firstfloor.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=reply@codereview.appspotmail.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).