<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 5, 2014 at 7:59 PM, Nick Lewycky <span dir="ltr"><<a href="mailto:nicholas@mxc.ca" target="_blank" class="cremed">nicholas@mxc.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc 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>You can use DEBUG_TYPE here, can you not?</div><div><br></div><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().</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc 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>Same question here.</div><div> </div><div><br></div><div></div></div><br></div><div class="gmail_extra">Thanks. Diego.</div></div>