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

Jan Voung jvoung at chromium.org
Thu Feb 28 08:55:39 PST 2013


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.



>
>
>>  Hey, good idea. Wonder if we should do this in general and make
>> statistics gathering dependent upon NDEBUG?
>>
>>
>>> -      unsigned NumFastIselRemaining = std::distance(Begin, End);
>>> +      unsigned NumFastIselRemaining = 0;
>>> +      NumFastIselRemaining = std::distance(Begin, End);
>>>
>>
>> Eh?
>>
>>
>>
>> I wanted to silence a warning because this variable is unused in Release.
>>  Do you prefer that I silence it in another way ?
>>
>>
>  It's used just a few lines below:
>
>       unsigned NumFastIselRemaining = 0;
>       NumFastIselRemaining = std::distance(Begin, End);
>       // Do FastISel on as many instructions as possible.
>
>       for (; BI != Begin; --BI) {
>         const Instruction *Inst = llvm::prior(BI);
>
>         // If we no longer require this instruction, skip it.
>
>         if (isFoldedOrDeadInstruction(Inst, FuncInfo)) {
>           --NumFastIselRemaining;
>           continue;
>         }
>
>
> none of which is conditional on NDEBUG afaict? I could be missing
> something though.
>
> I do see RemainingNow, NumFastIselSuccess, and NumDAGIselRetries as unused.
>
> The normal way is to cast to void if it's actually not being used for some
> reason.
>
> -eric
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130228/bb718427/attachment.html>


More information about the llvm-commits mailing list