<div dir="ltr">ClangBuildAnalyzer is interesting. I used it to make one change to LLVM already:<div><a href="https://github.com/llvm/llvm-project/commit/285cf9a84e1bd2f601b097fc29f75ea4c7779eba">https://github.com/llvm/llvm-project/commit/285cf9a84e1bd2f601b097fc29f75ea4c7779eba</a> </div><div>You can see the analysis output that change was informed by here:</div><div><a href="https://reviews.llvm.org/P8171">https://reviews.llvm.org/P8171</a> <br></div><div>The next area of interest I identified was printAliasInstr, which produced this patch:</div><div><a href="https://reviews.llvm.org/D70650">https://reviews.llvm.org/D70650</a> </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 4, 2019 at 8:51 AM Ben Craig via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Note that <a href="https://github.com/aras-p/ClangBuildAnalyzer" rel="noreferrer" target="_blank">https://github.com/aras-p/ClangBuildAnalyzer</a> already has some information that helps in these kinds of diagnosing. It consumes the traces from -ftime-trace. It has good ways of saying which template instantiations took too long over your code base, and hacky ways of saying which templates took too long to instantiate (I wrote the hacky thing). Here's a more recent view into the output that you can get: <a href="https://github.com/aras-p/ClangBuildAnalyzer/blob/master/tests/self-win-clang-cl-9.0rc2/_AnalysisOutputExpected.txt" rel="noreferrer" target="_blank">https://github.com/aras-p/ClangBuildAnalyzer/blob/master/tests/self-win-clang-cl-9.0rc2/_AnalysisOutputExpected.txt</a><br>
<br>
I will say that one gap in this profiling tool is large quantities of tiny functions / templates, e.g. std::move. -ftime-trace won't trace events that are sufficiently small, so it can miss things like std::move that involve a huge quantity of tiny instantiations.<br>
<br>
> -----Original Message-----<br>
> From: cfe-dev <<a href="mailto:cfe-dev-bounces@lists.llvm.org" target="_blank">cfe-dev-bounces@lists.llvm.org</a>> On Behalf Of Brian Gesiak<br>
> via cfe-dev<br>
> Sent: Wednesday, December 4, 2019 10:04 AM<br>
> To: David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>><br>
> Cc: cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>><br>
> Subject: [EXTERNAL] Re: [cfe-dev] [RFC] Identifying wasteful template<br>
> function bodies<br>
> <br>
> Awesome, thanks all!<br>
> <br>
> > On Mon, Dec 2, 2019 at 2:42 PM Reid Kleckner via cfe-dev <cfe-<br>
> <a href="mailto:dev@lists.llvm.org" target="_blank">dev@lists.llvm.org</a>> wrote:<br>
> >> I like this idea. I'm not sure a warning is the best way to surface it. The first<br>
> alternative that occurs to be would be the -ftime-trace JSON file, so you can<br>
> dump out complete info about the most often instantiated templates, how<br>
> many nodes they contained, and how many of them were dependent.<br>
> <br>
> This is a great idea. I'll try to get this working and send a patch.<br>
> <br>
> The discussion on ADL was interesting as well. I'm glad I asked the list,<br>
> thanks!<br>
> <br>
> - Brian<br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
> <a href="https://urldefense.com/v3/__https://lists.llvm.org/cgi-" rel="noreferrer" target="_blank">https://urldefense.com/v3/__https://lists.llvm.org/cgi-</a><br>
> bin/mailman/listinfo/cfe-dev__;!!FbZ0ZwI3Qg!-<br>
> pVFNcaaFVYdPdIuBJkdNWBPr_-Z-PjM8KlbAi71-2e56yNnxYZYarYnQ6WN$<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>