diff --git a/llvm/include/llvm/IR/PassManager.h b/llvm/include/llvm/IR/PassManager.h --- a/llvm/include/llvm/IR/PassManager.h +++ b/llvm/include/llvm/IR/PassManager.h @@ -503,9 +503,6 @@ for (unsigned Idx = 0, Size = Passes.size(); Idx != Size; ++Idx) { auto *P = Passes[Idx].get(); - if (DebugLogging) - dbgs() << "Running pass: " << P->name() << " on " << IR.getName() - << "\n"; // Check the PassInstrumentation's BeforePass callbacks before running the // pass, skip its execution completely if asked to (callback returns @@ -513,6 +510,10 @@ if (!PI.runBeforePass(*P, IR)) continue; + if (DebugLogging) + dbgs() << "Running pass: " << P->name() << " on " << IR.getName() + << "\n"; + PreservedAnalyses PassPA; { TimeTraceScope TimeScope(P->name(), IR.getName());