HI Markus.
I made some attempts to print both class name and pass name earlier this year.
One problem was that the getPassNameForClassName data base didn’t use a 1-1 mapping, so many “pass names” where mapped to the same “class name”.
I made some patches for that, but there might still be some 1-n mappings left (for example https://reviews.llvm.org/D105007 was never accepted so it remains to be dealt with).
Below are parts of the patch I was working on to print the pass names.
Might notice that we need replace the logic in shouldPopulateClassToPassNames in some better way and not just use “true” to always populate the database(or can we always do that?).
And there is still a limitation that for passes with params we still won’t print the params (had perhaps been nice to at least indicate that by printing “pass-name<…>” to show that the pass use params but that they aren’t shown for passes with params).
diff --git a/llvm/include/llvm/Passes/StandardInstrumentations.h b/llvm/include/llvm/Passes/StandardInstrumentations.h
index 9011c52f20c1…df4004b10525 100644
— a/llvm/include/llvm/Passes/StandardInstrumentations.h
+++ b/llvm/include/llvm/Passes/StandardInstrumentations.h
@@ -102,6 +102,7 @@ private:
bool Enabled;
PrintPassOptions Opts;
int Indent = 0;
- PassInstrumentationCallbacks *PIC;
};
class PreservedCFGCheckerInstrumentation {
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 54c3289f538f…7fec0e63cb88 100644
— a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -445,7 +445,7 @@ AnalysisKey NoOpLoopAnalysis::Key;
/// it. This should be updated if new pass instrumentation wants to use the map.
/// We currently only use this for --print-before/after.
bool shouldPopulateClassToPassNames() {
- return !printBeforePasses().empty() || !printAfterPasses().empty();
- return !printBeforePasses().empty() || !printAfterPasses().empty() || true;
}
} // namespace
diff --git a/llvm/lib/Passes/StandardInstrumentations.cpp b/llvm/lib/Passes/StandardInstrumentations.cpp
index a03e0d4b597e…3745c922579c 100644
— a/llvm/lib/Passes/StandardInstrumentations.cpp
+++ b/llvm/lib/Passes/StandardInstrumentations.cpp
@@ -870,6 +871,8 @@ raw_ostream &PrintPassInstrumentation::print() {
void PrintPassInstrumentation::registerCallbacks(
PassInstrumentationCallbacks &PIC) {