[llvm] r176214 - The FastISEL should be fast. But when we record statistics we use atomic operations to increment the counters.

Eric Christopher echristo at gmail.com
Thu Feb 28 09:07:55 PST 2013


On Thu, Feb 28, 2013 at 9:01 AM, Eli Bendersky <eliben at google.com> wrote:

> On Thu, Feb 28, 2013 at 8:55 AM, Jan Voung <jvoung at chromium.org> wrote:
> > On Wed, Feb 27, 2013 at 2:50 PM, Eric Christopher <echristo at gmail.com>
> > wrote:
> >>
> >>
> >>
> >>
> >> On Wed, Feb 27, 2013 at 2:30 PM, Nadav Rotem <nrotem at apple.com> wrote:
> >>>
> >>> Hi Eric,
> >>>
> >>>>
> >>>> This patch disables the counters on non-debug builds. This reduces the
> >>>> runtime of SelectionDAGISel::SelectCodeCommon by ~5%.
> >>>
> >>>
> >>>
> >>> Most of the statistics numbers are under #ifndef NDEBUG.
> >>
> >>
> >> Throughout all of llvm? If so, cool. Was just wondering if we should
> solve
> >> this elsewhere rather than in each pass.
> >
> >
> > I may be building the wrong version, but I think I still see "Number of
> > insts selected by target-independent selector", and the stat for the
> > target-specific selector.  Is that going to add up to the same number as
> > "NumFastIselSuccess", which was just put under DEBUG() here?
> >
> > Also, I've also seen some of the assembler stats like "Number of machine
> > instrs printed" count up to largish numbers.
> >
>
> These come from FastISel.cpp:
>
>
> STATISTIC(NumFastIselSuccessIndependent, "Number of insts selected by "
>           "target-independent selector");
> STATISTIC(NumFastIselSuccessTarget, "Number of insts selected by "
>           "target-specific selector");
> STATISTIC(NumFastIselDead, "Number of dead insts removed on failure");
>
> Unlike the counter Nadav put under DEBUG, these one get reported in
> non-debug runs as well. Would it make sense to move them under DEBUG
> as well?
>

This is what I was talking about that Nadav never bothered to respond to.
Whether or not it made sense to put all of the statistics as only firing
during
debug builds and then making the change in the statistics framework rather
than #if NDEBUG for each set of statistics and the assorted increments.

-eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130228/9982e0bc/attachment.html>


More information about the llvm-commits mailing list