[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 13:26:17 PST 2013


On Thu, Feb 28, 2013 at 1:15 PM, Eli Bendersky <eliben at google.com> wrote:

> >> > It's why I was asking, I think it might be an interesting idea to put
> >> > all
> >> > the statistics
> >> > behind NDEBUG so we can feel free to collect stats whenever rather
> than
> >> > needing to worry about putting the high firing status under NDEBUG
> >> > explicitly.
> >>
> >> FWIW, I'm +1 on this. You'll still have to wrap the actual ++counter
> >> code with DEBUG or some other macro-fu all over the code, though.
> >>
> >> Eil
> >
> >
> >
> > Perhaps we could just re-define the operator++(), operator--(), etc. in
> > Statistics.h to only do real work "#if !defined(NDEBUG) ||
> > defined(LLVM_ENABLE_STATS)", and to be nops otherwise.  Where
> > LLVM_ENABLE_STATS would be like LLVM_ENABLE_DUMP...   If that sounds
> > reasonable, I could spin up a patch.
>
> +1. I like the idea of also having LLVM_ENABLE_STATS, so that if
> anyone for some reason wants these stats for a release build, that
> becomes possible too.
>

Agreed.

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


More information about the llvm-commits mailing list