[PATCH] D43578: -ftime-report switch support in Clang

Erik Pilkington via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 23 07:46:17 PST 2018


erik.pilkington added a comment.

Hi, thanks for working on this! Having better timers in clang would be really great.

> But the main idea of this version of the patch was to get understanding about interesting timers: what exactly do we want to see in report? Parser only? Sema? Some special parts of Clang Code Gen?...

I think it would be a good idea to include timers on specific parts of the compiler that can often lead to big compile times, off the top of my head: constant evaluation, template instantiation, analysis based warnings, macro expansion (looks like you've already done this), and name lookup would all be really nice to have. Having these general timers like "Parse Template" that track the time spent in a parsing function don't really seem that valuable to me because they don't really give any indication as to how that time was actually spent. If the parser calls into sema then sema could start doing any number of things that would be included in the parser's timer, and nobody would have any insight into what actually needs to be optimized. What do you think about that?



================
Comment at: include/clang/Lex/Preprocessor.h:145-146
   ExternalPreprocessorSource *ExternalSource;
+  StringRef GroupName = "clangparser";
+  StringRef GroupDescription = "===== Clang Parser =====";
 
----------------
Making these non-static members is a waste of memory. Please make them `static constexpr` or just inline them into where they're used.


================
Comment at: lib/Parse/ParseStmt.cpp:102
                                     SourceLocation *TrailingElseLoc) {
-
   ParenBraceBracketBalancer BalancerRAIIObj(*this);
----------------
Please don't include these unrelated whitespace changes in the diff!


https://reviews.llvm.org/D43578





More information about the llvm-commits mailing list