<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 7 May 2014 09:24, Diego Novillo <span dir="ltr"><<a href="mailto:dnovillo@google.com" target="_blank">dnovillo@google.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 dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="">On Mon, May 5, 2014 at 7:59 PM, Nick Lewycky <span dir="ltr"><<a href="mailto:nicholas@mxc.ca" target="_blank">nicholas@mxc.ca</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"><br>
+        if (SafeToTail) {<br>
+          F.getContext().emitOptimizationRemark(<br>
+              "tailcallelim", F, CI->getDebugLoc(),<br>
+              "found readnone tail call candidate");<br></blockquote><div><br></div></div><div>You can use DEBUG_TYPE here, can you not?</div></div></div></div></blockquote><div><br></div><div>I could but I'd rather not? It's the pass name and that's spelled out in other places it's used in this file. If emitOptimizationRemark is compiled away when DEBUG is disabled, then it'd be clear that I'm supposed to use it. Otherwise it seems like I'm using what ought to be our interface to the DEBUG mechanism for something else.</div>

<div><br></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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote">

<div>This seems to be a transformation remark, but the text implies that it's an analysis remark. I'm adding support for -Rpass-analysis shortly, so I want to make sure whether this will fall under the category of 'applied optimization' or 'analysis result' (which will have a different call, something like emitOptimizationAnalysisRemark().<br>

</div></div></div></div></blockquote><div><br></div><div>It's a transform remark. Text improved in r208370.</div><div><br></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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class=""><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">


+  for (CallInst *CI : DeferredTails) {<br>
+    if (Visited[CI->getParent()] != ESCAPED) {<br>
+      // If the escape point was part way through the block, calls after the<br>
+      // escape point wouldn't have been put into DeferredTails.<br>
+      F.getContext().emitOptimizationRemark(<br>
+          "tailcallelim", F, CI->getDebugLoc(), "found tail call candidate");<br>
+      CI->setTailCall();<br>
+      Modified = true;<br></blockquote><div><br></div></div><div>Same question here.</div></div></div></div></blockquote><div><br></div><div>Same answer here.</div><div><br></div><div>Nick</div><div><br></div></div><br>

</div></div>