<br><br><div class="gmail_quote">On Tue Oct 21 2014 at 3:39:09 PM David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Oct 21, 2014 at 3:31 PM, 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Tue, Oct 21, 2014 at 6:24 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">================<br>
Comment at: lib/Transforms/Scalar/SampleProfile.cpp:647<br>
@@ -645,2 +646,3 @@<br>
+                                          const LLVMContext &Ctx) {<br>
   NamedMDNode *CUNodes = F.getParent()->getNamedMetadata("<a href="http://llvm.dbg.cu" target="_blank">llvm.dbg.cu</a>");<br>
   if (CUNodes) {<br>
----------------<br>
Why do we need this code at all? Should we just remove it in favor of the other code?<br></blockquote><div><br></div></div></div><div>I was actually going to ask you.  It seemed to me that this variant might be slightly more efficient than the one that does not rely on <a href="http://llvm.dbg.cu" target="_blank">llvm.dbg.cu</a>?</div><div>(all the insn iteration, I mean).</div></div></div></div></blockquote></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br>Chances are you'll find it in the first handful of instructions (just past the prolog) and only have to iterate the entire contents of nodebug functions (unless anything's been inlined into them, in which case you'll be able to stop sooner). It may be less work than iterating through (N/2) subprograms.<br> </div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>If you don't  think that's the case, then it certainly is simpler if I just remove it altogether.<br></div></div></div></div></blockquote></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br>Yeah, I'd kill it off unless we one day find this to be a real bottleneck in which case we can figure out how to make it better (probably by building the function->subprogram map once & keeping it around for use).</div></div></div></div></blockquote><div><br></div><div>No objections here. I'd thought it would be a bit faster, but I also agree with your idea for making it faster if we need to.</div><div><br></div><div>-eric </div></div>