diff --git a/llvm/lib/Passes/StandardInstrumentations.cpp b/llvm/lib/Passes/StandardInstrumentations.cpp --- a/llvm/lib/Passes/StandardInstrumentations.cpp +++ b/llvm/lib/Passes/StandardInstrumentations.cpp @@ -726,8 +726,7 @@ } void PrintIRInstrumentation::printAfterPassInvalidated(StringRef PassID) { - StringRef PassName = PIC->getPassNameForClassName(PassID); - if (!shouldPrintAfterPass(PassName)) + if (!shouldPrintAfterPass(PassID)) return; if (isIgnored(PassID)) diff --git a/llvm/test/Other/loop-print-after-pass-invalidated.ll b/llvm/test/Other/loop-print-after-pass-invalidated.ll new file mode 100644 --- /dev/null +++ b/llvm/test/Other/loop-print-after-pass-invalidated.ll @@ -0,0 +1,21 @@ +; RUN: opt < %s 2>&1 -disable-output \ +; RUN: -passes='simple-loop-unswitch' \ +; RUN: -print-after=simple-loop-unswitch \ +; RUN: | FileCheck %s + +; CHECK: *** IR Dump After SimpleLoopUnswitchPass on for.cond *** +; CHECK: *** IR Dump After SimpleLoopUnswitchPass on for.cond.us *** + +define void @loop(i1 %w) { +entry: + br label %for.cond +; Loop: +for.cond: ; preds = %for.inc, %entry + br i1 %w, label %for.inc, label %if.then + +if.then: ; preds = %for.cond + br label %for.inc + +for.inc: ; preds = %if.then, %for.cond + br label %for.cond +}