<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 27, 2013 at 2:30 PM, Nadav Rotem <span dir="ltr"><<a href="mailto:nrotem@apple.com" target="_blank">nrotem@apple.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Eric, <div><br></div>
<div><div><div><div><blockquote type="cite"><blockquote class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>This patch disables the counters on non-debug builds. This reduces the runtime of SelectionDAGISel::SelectCodeCommon by ~5%.<br></blockquote><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

<br></div></blockquote><div><br></div></div><div>Most of the statistics numbers are under #ifndef NDEBUG. </div></div></div></div></div></blockquote><div><br></div><div>Throughout all of llvm? If so, cool. Was just wondering if we should solve this elsewhere rather than in each pass.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div><div>
<div><blockquote type="cite"><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

Hey, good idea. Wonder if we should do this in general and make statistics gathering dependent upon NDEBUG?</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

 </div><blockquote class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

-      unsigned NumFastIselRemaining = std::distance(Begin, End);<br>+      unsigned NumFastIselRemaining = 0;<br>+      NumFastIselRemaining = std::distance(Begin, End);<br></blockquote><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

<br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

Eh?</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

 </div></blockquote><div><br></div></div><div>I wanted to silence a warning because this variable is unused in Release.  Do you prefer that I silence it in another way ?</div><div><br></div></div></div></div></div></blockquote>

<div><br></div><div style> It's used just a few lines below:</div><div style><br></div><div style><div>      unsigned NumFastIselRemaining = 0;</div><div>      NumFastIselRemaining = std::distance(Begin, End);</div><div>
      // Do FastISel on as many instructions as possible.                                                               </div><div>      for (; BI != Begin; --BI) {</div><div>        const Instruction *Inst = llvm::prior(BI);</div>
<div><br></div><div>        // If we no longer require this instruction, skip it.                                                           </div><div>        if (isFoldedOrDeadInstruction(Inst, FuncInfo)) {</div><div>          --NumFastIselRemaining;</div>
<div>          continue;</div><div>        }</div><div><br></div><div><br></div><div style>none of which is conditional on NDEBUG afaict? I could be missing something though. </div><div style><br></div><div style>I do see RemainingNow, NumFastIselSuccess, and NumDAGIselRetries as unused.</div>
<div style><br></div><div style>The normal way is to cast to void if it's actually not being used for some reason.</div><div style><br></div><div style>-eric</div></div></div></div></div>