Skip to content

Commit f6f0690

Browse files
committed
[StandardInstrumentation] Annotate loops with the function name
When analyzing pass debug output it is helpful to have the function name along with the loop name.
1 parent cf2f32c commit f6f0690

File tree

3 files changed

+6
-5
lines changed

3 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
@@ -245,7 +245,8 @@ std::string getIRName(Any IR) {
245245
return C->getName();
246246

247247
if (const auto *L = unwrapIR<Loop>(IR))
248-
return L->getName().str();
248+
return "Loop: [ " + L->getName().str() + " ] In Function: [ " +
249+
L->getHeader()->getParent()->getName().str() + " ]";
249250

250251
if (const auto *MF = unwrapIR<MachineFunction>(IR))
251252
return MF->getName().str();

llvm/test/Transforms/LoopPredication/invalidate-analyses.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
; please update this test some other analysis that isn't preserved.
66

77
; CHECK: Running analysis: LazyValueAnalysis on drop_a_wc_and_leave_early
8-
; CHECK: Running pass: LoopPredicationPass on loop
8+
; CHECK: Running pass: LoopPredicationPass on Loop: [ loop ] In Function: [ drop_a_wc_and_leave_early ]
99
; CHECK: Invalidating analysis: LazyValueAnalysis on drop_a_wc_and_leave_early
1010
; CHECK: Running analysis: LazyValueAnalysis on drop_a_wc_and_leave
11-
; CHECK: Running pass: LoopPredicationPass on loop
11+
; CHECK: Running pass: LoopPredicationPass on Loop: [ loop ] In Function: [ drop_a_wc_and_leave ]
1212
; CHECK: Invalidating analysis: LazyValueAnalysis on drop_a_wc_and_leave
1313

1414

llvm/test/Transforms/SimpleLoopUnswitch/nontrivial-unswitch-markloopasdeleted.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
; SimpleLoopUnswitch not marking the Loop as removed, so we missed clearing
1818
; the analysis caches.
1919
;
20-
; CHECK: Running pass: SimpleLoopUnswitchPass on loop_begin
20+
; CHECK: Running pass: SimpleLoopUnswitchPass on Loop: [ loop_begin ] In Function: [ test6 ]
2121
; CHECK-NEXT: Running analysis: OuterAnalysisManagerProxy
22-
; CHECK-NEXT: Clearing all analysis results for: loop_a_inner
22+
; CHECK-NEXT: Clearing all analysis results for: Loop [ loop_a_inner ] In Function: [ test6 ]
2323

2424

2525
; When running loop-distribute the second time we can see that loop_a_inner

0 commit comments

Comments
 (0)