Skip to content

Commit cb5612c

Browse files
committed
Add IR name to -print-pass-numbers output
Print the name of the module/function/loop the pass ran on.
1 parent d342843 commit cb5612c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

llvm/lib/Passes/StandardInstrumentations.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,8 @@ void PrintIRInstrumentation::printBeforePass(StringRef PassID, Any IR) {
812812
++CurrentPassNumber;
813813

814814
if (shouldPrintPassNumbers())
815-
dbgs() << " Running pass " << CurrentPassNumber << " " << PassID << "\n";
815+
dbgs() << " Running pass " << CurrentPassNumber << " " << PassID
816+
<< " on " << getIRName(IR) << "\n";
816817

817818
if (!shouldPrintBeforePass(PassID))
818819
return;

llvm/test/Other/print-at-pass-number.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ bb4: ; preds = %bb1
2424
ret i32 %add3
2525
}
2626

27-
; NUMBER: Running pass 1 LoopSimplifyPass
28-
; NUMBER-NEXT: Running pass 2 LCSSAPass
29-
; NUMBER-NEXT: Running pass 3 IndVarSimplifyPass
30-
; NUMBER-NEXT: Running pass 4 LoopDeletionPass
27+
; NUMBER: Running pass 1 LoopSimplifyPass on bar
28+
; NUMBER-NEXT: Running pass 2 LCSSAPass on bar
29+
; NUMBER-NEXT: Running pass 3 IndVarSimplifyPass on bb1
30+
; NUMBER-NEXT: Running pass 4 LoopDeletionPass on bb1
3131
; NUMBER-NOT: Running pass

0 commit comments

Comments
 (0)