This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [google] Propagate profile information to RTL level during switch expansion


On Tue, Jan 31, 2012 at 10:16 PM, Xinliang David Li <davidxl@google.com> wrote:
> Ok for google branch with minor changes below.
>
> thanks,
>
> David
>
>>> +#define case_probability(x, y) ((y) ? ((x) * REG_BR_PROB_BASE ?/ (y)) ?: -1)
>>> +
>
> Using upper case for macro?
From http://gcc.gnu.org/codingconventions.html,

"Macros names should be in ALL_CAPS when it's important to be aware
that it's a macro (e.g. accessors and simple predicates), but in
lowercase (e.g., size_int) where the macro is a wrapper for efficiency
that should be considered as a function"

In this case case_probability is a wrapper for efficiency and hence I
decided to go with the lower case name.


>>> + ? ? ? ? ? ? ? ? ?count -= default_count;
>>> + ? ? ? ? ? ? ? ? ?default_count = 0;
>
> Why resetting it to 0?

If there are no gaps, then the indirect jump can't jump to the default
label. Later I set
          default_edge->count = default_count;
and this value should be 0 if there are no gaps.

I have addressed the rest of your comments.

-Easwaran


>
>
>>> +
>>> +static void
>>> +add_prob_note_to_last_insn(int probability)
>>> +{
>
> Missing document.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]