<div dir="ltr">Hi Steve:<div><br></div><div>llvm::errs() is unbuffered, so that might explain it.  Could you try llvm::outs() instead and see if that helps.</div><div><br></div><div>hth...</div><div>don</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 5, 2015 at 11:17 AM, Stephen Thomas via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</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">Hi all,<div><br></div><div>When writing my custom passes, I often emit log messages to llvm::errs() like so:</div><div><br></div><div>llvm::errs() << "Could not handle instruction: " << *Inst << std::endl;</div><div><br></div><div>where Inst is a pointer to an Instruction.</div><div><br></div><div>I've profiled my code and found that this way of printing an Instruction takes a very long time: indeed, it is the bottleneck of my pass. </div><div><br></div><div>Of course, I could always switch these log messages off for production runs, but during development and debugging, I'd like to have them on to make debugging much easier.</div><div><br></div><div>Is there a faster way to print an Instruction?</div><div><br></div><div>Thanks,</div><div>Steve</div></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>