[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
Wed Feb 27 14:50:37 PST 2013
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.
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130227/580146be/attachment.html>
More information about the llvm-commits
mailing list