Skip to content

Commit d4de7c2

Browse files
pchintalapudiaeubanks
authored andcommitted
[NewPM] Use PassID instead of pass name
PrintIRInstrumentation::shouldPrintAfterPass accepts a pass ID instead of a pass name Reviewed By: aeubanks Differential Revision: https://reviews.llvm.org/D147394
1 parent f49e0c8 commit d4de7c2

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

llvm/lib/Passes/StandardInstrumentations.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,7 @@ void PrintIRInstrumentation::printAfterPass(StringRef PassID, Any IR) {
726726
}
727727

728728
void PrintIRInstrumentation::printAfterPassInvalidated(StringRef PassID) {
729-
StringRef PassName = PIC->getPassNameForClassName(PassID);
730-
if (!shouldPrintAfterPass(PassName))
729+
if (!shouldPrintAfterPass(PassID))
731730
return;
732731

733732
if (isIgnored(PassID))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
; RUN: opt < %s 2>&1 -disable-output \
2+
; RUN: -passes='simple-loop-unswitch<nontrivial>' \
3+
; RUN: -print-after=simple-loop-unswitch \
4+
; RUN: | FileCheck %s
5+
6+
; CHECK: *** IR Dump After SimpleLoopUnswitchPass on for.cond ***
7+
; CHECK: *** IR Dump After SimpleLoopUnswitchPass on for.cond.us ***
8+
9+
define void @loop(i1 %w) {
10+
entry:
11+
br label %for.cond
12+
; Loop:
13+
for.cond: ; preds = %for.inc, %entry
14+
br i1 %w, label %for.inc, label %if.then
15+
16+
if.then: ; preds = %for.cond
17+
br label %for.inc
18+
19+
for.inc: ; preds = %if.then, %for.cond
20+
br label %for.cond
21+
}

0 commit comments

Comments
 (0)