[PATCH] D131960: [Clang] Reimplement time tracing of NewPassManager by PassInstrumentation framework

Jamie Schmeiser via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 17 08:13:44 PDT 2022


jamieschmeiser added inline comments.


================
Comment at: llvm/lib/IR/PassTimeProfiling.cpp:42
+namespace {
+std::string getIRName(Any IR) {
+  if (any_isa<const Module *>(IR))
----------------
This looks like it is copied with changes from Passes/StandardInstructions.cpp.  You should almost never replicate code for several reasons.  1) If there is a bug in the code, it probably won't be fixed in all the copies; 2) code bloat 3) It is confusing because it is unexpected.  If there are only minor changes, it is difficult to recognize the changes.  I see that the loop case is different.  Perhaps a parameter to control what happens for a loop?  Why not put the new functionality in Passes/StandardInstructions.cpp?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131960/new/

https://reviews.llvm.org/D131960



More information about the llvm-commits mailing list