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

Eli Bendersky eliben at google.com
Thu Feb 28 09:01:34 PST 2013


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?

Eli



More information about the llvm-commits mailing list