[llvm] StandardInstrumentation: Fix behavior of -ir-dump-directory with -print-before-pass-number (PR #130983)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 12 08:46:13 PDT 2025
https://github.com/arsenm created https://github.com/llvm/llvm-project/pull/130983
When using -print-before-pass-number, the result would still be
printed to stderr instead of the file. This was due to pre-filtering
cases where a temporary string for the filename prior to incrementing
the current pass number. I found the tracking of this partial filename string
confusing, so just defer that until the filename is really used.
The ugliest piece of this is IRFileDisplayName - this needs to be
computed on the original IR before before any invalidation.
>From a854430086c317c70054a9a6e106b5baf6fd531a Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Wed, 12 Mar 2025 19:03:13 +0700
Subject: [PATCH] StandardInstrumentation: Fix -ir-dump-directory with
-print-before-pass-number
When using -print-before-pass-number, the result would still be
printed to stderr instead of the file. This was due to pre-filtering
cases where a temporary string for the filename prior to incrementing
the current pass number. I found the tracking of this partial filename string
confusing, so just defer that until the filename is really used.
The ugliest piece of this is IRFileDisplayName - this needs to be
computed on the original IR before before any invalidation.
---
.../llvm/Passes/StandardInstrumentations.h | 28 +++--
llvm/lib/Passes/StandardInstrumentations.cpp | 101 ++++++++----------
.../Other/dump-before-after-pass-number.ll | 65 +++++++++++
llvm/test/Other/dump-before-after.ll | 38 +++----
4 files changed, 151 insertions(+), 81 deletions(-)
create mode 100644 llvm/test/Other/dump-before-after-pass-number.ll
diff --git a/llvm/include/llvm/Passes/StandardInstrumentations.h b/llvm/include/llvm/Passes/StandardInstrumentations.h
index 2af73cb714a76..f7a65a88ecf5b 100644
--- a/llvm/include/llvm/Passes/StandardInstrumentations.h
+++ b/llvm/include/llvm/Passes/StandardInstrumentations.h
@@ -53,14 +53,16 @@ class PrintIRInstrumentation {
private:
struct PassRunDescriptor {
const Module *M;
- const std::string DumpIRFilename;
+ const unsigned PassNumber;
+ const std::string IRFileDisplayName;
const std::string IRName;
const StringRef PassID;
- PassRunDescriptor(const Module *M, std::string DumpIRFilename,
- std::string IRName, const StringRef PassID)
- : M{M}, DumpIRFilename{DumpIRFilename}, IRName{IRName}, PassID(PassID) {
- }
+ PassRunDescriptor(const Module *M, unsigned PassNumber,
+ std::string &&IRFileDisplayName, std::string &&IRName,
+ const StringRef PassID)
+ : M{M}, PassNumber{PassNumber}, IRFileDisplayName(IRFileDisplayName),
+ IRName{IRName}, PassID(PassID) {}
};
void printBeforePass(StringRef PassID, Any IR);
@@ -75,10 +77,20 @@ class PrintIRInstrumentation {
bool shouldPrintBeforeSomePassNumber();
bool shouldPrintAfterSomePassNumber();
- void pushPassRunDescriptor(StringRef PassID, Any IR,
- std::string &DumpIRFilename);
+ void pushPassRunDescriptor(StringRef PassID, Any IR, unsigned PassNumber);
PassRunDescriptor popPassRunDescriptor(StringRef PassID);
- std::string fetchDumpFilename(StringRef PassId, Any IR);
+
+ enum class IRDumpFileSuffixType {
+ Before,
+ After,
+ Invalidated,
+ };
+
+ static StringRef
+ getFileSuffix(PrintIRInstrumentation::IRDumpFileSuffixType Type);
+ std::string fetchDumpFilename(StringRef PassId, StringRef IRFileDisplayName,
+ unsigned PassNumber,
+ IRDumpFileSuffixType SuffixType);
PassInstrumentationCallbacks *PIC;
/// Stack of Pass Run descriptions, enough to print the IR unit after a given
diff --git a/llvm/lib/Passes/StandardInstrumentations.cpp b/llvm/lib/Passes/StandardInstrumentations.cpp
index 5d4f9ac1496fc..4c59278eaaa01 100644
--- a/llvm/lib/Passes/StandardInstrumentations.cpp
+++ b/llvm/lib/Passes/StandardInstrumentations.cpp
@@ -755,9 +755,7 @@ PrintIRInstrumentation::~PrintIRInstrumentation() {
"PassRunDescriptorStack is not empty at exit");
}
-static SmallString<32> getIRFileDisplayName(Any IR) {
- SmallString<32> Result;
- raw_svector_ostream ResultStream(Result);
+static void writeIRFileDisplayName(raw_ostream &ResultStream, Any IR) {
const Module *M = unwrapModule(IR, /*Force=*/true);
assert(M && "should have unwrapped module");
uint64_t NameHash = xxh3_64bits(M->getName());
@@ -786,44 +784,44 @@ static SmallString<32> getIRFileDisplayName(Any IR) {
} else {
llvm_unreachable("Unknown wrapped IR type");
}
+}
+
+static std::string getIRFileDisplayName(Any IR) {
+ std::string Result;
+ raw_string_ostream ResultStream(Result);
+ writeIRFileDisplayName(ResultStream, IR);
return Result;
}
-std::string PrintIRInstrumentation::fetchDumpFilename(StringRef PassName,
- Any IR) {
- const StringRef RootDirectory = IRDumpDirectory;
- assert(!RootDirectory.empty() &&
+StringRef PrintIRInstrumentation::getFileSuffix(IRDumpFileSuffixType Type) {
+ static constexpr std::array FileSuffixes = {"-before.ll", "-after.ll",
+ "-invalidated.ll"};
+ return FileSuffixes[static_cast<size_t>(Type)];
+}
+
+std::string PrintIRInstrumentation::fetchDumpFilename(
+ StringRef PassName, StringRef IRFileDisplayName, unsigned PassNumber,
+ IRDumpFileSuffixType SuffixType) {
+ assert(!IRDumpDirectory.empty() &&
"The flag -ir-dump-directory must be passed to dump IR to files");
- SmallString<128> ResultPath;
- ResultPath += RootDirectory;
+
SmallString<64> Filename;
raw_svector_ostream FilenameStream(Filename);
- FilenameStream << CurrentPassNumber;
- FilenameStream << "-";
- FilenameStream << getIRFileDisplayName(IR);
- FilenameStream << "-";
+ FilenameStream << PassNumber;
+ FilenameStream << '-' << IRFileDisplayName << '-';
FilenameStream << PassName;
- sys::path::append(ResultPath, Filename);
- return std::string(ResultPath);
-}
+ FilenameStream << getFileSuffix(SuffixType);
-enum class IRDumpFileSuffixType {
- Before,
- After,
- Invalidated,
-};
-
-static StringRef getFileSuffix(IRDumpFileSuffixType Type) {
- static constexpr std::array FileSuffixes = {"-before.ll", "-after.ll",
- "-invalidated.ll"};
- return FileSuffixes[static_cast<size_t>(Type)];
+ SmallString<128> ResultPath;
+ sys::path::append(ResultPath, IRDumpDirectory, Filename);
+ return std::string(ResultPath);
}
-void PrintIRInstrumentation::pushPassRunDescriptor(
- StringRef PassID, Any IR, std::string &DumpIRFilename) {
+void PrintIRInstrumentation::pushPassRunDescriptor(StringRef PassID, Any IR,
+ unsigned PassNumber) {
const Module *M = unwrapModule(IR);
- PassRunDescriptorStack.emplace_back(
- PassRunDescriptor(M, DumpIRFilename, getIRName(IR), PassID));
+ PassRunDescriptorStack.emplace_back(M, PassNumber, getIRFileDisplayName(IR),
+ getIRName(IR), PassID);
}
PrintIRInstrumentation::PassRunDescriptor
@@ -857,19 +855,12 @@ void PrintIRInstrumentation::printBeforePass(StringRef PassID, Any IR) {
if (isIgnored(PassID))
return;
- std::string DumpIRFilename;
- if (!IRDumpDirectory.empty() &&
- (shouldPrintBeforePass(PassID) || shouldPrintAfterPass(PassID) ||
- shouldPrintBeforeCurrentPassNumber() ||
- shouldPrintAfterCurrentPassNumber()))
- DumpIRFilename = fetchDumpFilename(PassID, IR);
-
// Saving Module for AfterPassInvalidated operations.
// Note: here we rely on a fact that we do not change modules while
// traversing the pipeline, so the latest captured module is good
// for all print operations that has not happen yet.
if (shouldPrintAfterPass(PassID))
- pushPassRunDescriptor(PassID, IR, DumpIRFilename);
+ pushPassRunDescriptor(PassID, IR, CurrentPassNumber);
if (!shouldPrintIR(IR))
return;
@@ -881,7 +872,7 @@ void PrintIRInstrumentation::printBeforePass(StringRef PassID, Any IR) {
<< " on " << getIRName(IR) << "\n";
if (shouldPrintAfterCurrentPassNumber())
- pushPassRunDescriptor(PassID, IR, DumpIRFilename);
+ pushPassRunDescriptor(PassID, IR, CurrentPassNumber);
if (!shouldPrintBeforePass(PassID) && !shouldPrintBeforeCurrentPassNumber())
return;
@@ -894,8 +885,10 @@ void PrintIRInstrumentation::printBeforePass(StringRef PassID, Any IR) {
unwrapAndPrint(Stream, IR);
};
- if (!DumpIRFilename.empty()) {
- DumpIRFilename += getFileSuffix(IRDumpFileSuffixType::Before);
+ if (!IRDumpDirectory.empty()) {
+ std::string DumpIRFilename =
+ fetchDumpFilename(PassID, getIRFileDisplayName(IR), CurrentPassNumber,
+ IRDumpFileSuffixType::Before);
llvm::raw_fd_ostream DumpIRFileStream{
prepareDumpIRFileDescriptor(DumpIRFilename), /* shouldClose */ true};
WriteIRToStream(DumpIRFileStream);
@@ -911,7 +904,8 @@ void PrintIRInstrumentation::printAfterPass(StringRef PassID, Any IR) {
if (!shouldPrintAfterPass(PassID) && !shouldPrintAfterCurrentPassNumber())
return;
- auto [M, DumpIRFilename, IRName, StoredPassID] = popPassRunDescriptor(PassID);
+ auto [M, PassNumber, IRFileDisplayName, IRName, StoredPassID] =
+ popPassRunDescriptor(PassID);
assert(StoredPassID == PassID && "mismatched PassID");
if (!shouldPrintIR(IR) ||
@@ -927,12 +921,11 @@ void PrintIRInstrumentation::printAfterPass(StringRef PassID, Any IR) {
};
if (!IRDumpDirectory.empty()) {
- assert(!DumpIRFilename.empty() && "DumpIRFilename must not be empty and "
- "should be set in printBeforePass");
- const std::string DumpIRFilenameWithSuffix =
- DumpIRFilename + getFileSuffix(IRDumpFileSuffixType::After).str();
+ std::string DumpIRFilename =
+ fetchDumpFilename(PassID, getIRFileDisplayName(IR), CurrentPassNumber,
+ IRDumpFileSuffixType::After);
llvm::raw_fd_ostream DumpIRFileStream{
- prepareDumpIRFileDescriptor(DumpIRFilenameWithSuffix),
+ prepareDumpIRFileDescriptor(DumpIRFilename),
/* shouldClose */ true};
WriteIRToStream(DumpIRFileStream, IRName);
} else {
@@ -947,7 +940,8 @@ void PrintIRInstrumentation::printAfterPassInvalidated(StringRef PassID) {
if (!shouldPrintAfterPass(PassID) && !shouldPrintAfterCurrentPassNumber())
return;
- auto [M, DumpIRFilename, IRName, StoredPassID] = popPassRunDescriptor(PassID);
+ auto [M, PassNumber, IRFileDisplayName, IRName, StoredPassID] =
+ popPassRunDescriptor(PassID);
assert(StoredPassID == PassID && "mismatched PassID");
// Additional filtering (e.g. -filter-print-func) can lead to module
// printing being skipped.
@@ -965,13 +959,12 @@ void PrintIRInstrumentation::printAfterPassInvalidated(StringRef PassID) {
};
if (!IRDumpDirectory.empty()) {
- assert(!DumpIRFilename.empty() && "DumpIRFilename must not be empty and "
- "should be set in printBeforePass");
- const std::string DumpIRFilenameWithSuffix =
- DumpIRFilename + getFileSuffix(IRDumpFileSuffixType::Invalidated).str();
+ std::string DumpIRFilename =
+ fetchDumpFilename(PassID, IRFileDisplayName, PassNumber,
+ IRDumpFileSuffixType::Invalidated);
llvm::raw_fd_ostream DumpIRFileStream{
- prepareDumpIRFileDescriptor(DumpIRFilenameWithSuffix),
- /* shouldClose */ true};
+ prepareDumpIRFileDescriptor(DumpIRFilename),
+ /*shouldClose=*/true};
WriteIRToStream(DumpIRFileStream, M, IRName);
} else {
WriteIRToStream(dbgs(), M, IRName);
diff --git a/llvm/test/Other/dump-before-after-pass-number.ll b/llvm/test/Other/dump-before-after-pass-number.ll
new file mode 100644
index 0000000000000..c27db8c31f799
--- /dev/null
+++ b/llvm/test/Other/dump-before-after-pass-number.ll
@@ -0,0 +1,65 @@
+; Make sure that -print-before-pass-number works to write to a
+; temporary file, and not stderr, when combined with
+; -ir-dump-directory
+
+; RUN_PASS_NUMBERS: Running pass 1 NoOpModulePass on [module]
+; RUN_PASS_NUMBERS: Running pass 2 NoOpModulePass on [module]
+; RUN_PASS_NUMBERS: Running pass 3 NoOpModulePass on [module]
+
+
+; RUN: rm -rf %t/logs
+; RUN: opt %s -disable-output -passes='no-op-module,no-op-module,no-op-module' -print-before-pass-number=2 -print-pass-numbers -ir-dump-directory %t/logs 2>&1 | FileCheck -check-prefix=RUN_PASS_NUMBERS %s
+; RUN: ls %t/logs | FileCheck --check-prefix=BEFORE2 %s
+; RUN: ls %t/logs | count 1
+; BEFORE2: 2-[[MODULE_NAME_HASH:[a-z0-9]+]]-module-NoOpModulePass-before.ll
+
+; RUN: cat %t/logs/* | FileCheck -check-prefix=BEFORE2_COMMENT %s
+; BEFORE2_COMMENT: ; *** IR Dump Before 2-NoOpModulePass on [module] ***
+
+
+
+; RUN: rm -rf %t/logs
+; RUN: opt %s -disable-output -passes='no-op-module,no-op-module,no-op-module' -print-before-pass-number=1 -print-pass-numbers -ir-dump-directory %t/logs 2>&1 | FileCheck -check-prefix=RUN_PASS_NUMBERS %s
+; RUN: ls %t/logs | FileCheck --check-prefix=BEFORE1 %s
+; RUN: ls %t/logs | count 1
+
+; BEFORE1: 1-[[MODULE_NAME_HASH:[a-z0-9]+]]-module-NoOpModulePass-before.ll
+
+; RUN: cat %t/logs/* | FileCheck -check-prefix=BEFORE1_COMMENT %s
+; BEFORE1_COMMENT: ; *** IR Dump Before 1-NoOpModulePass on [module] ***
+
+
+
+; RUN: rm -rf %t/logs
+; RUN: opt %s -disable-output -passes='no-op-module,no-op-module,no-op-module' -print-after-pass-number=2 -print-pass-numbers -ir-dump-directory %t/logs 2>&1 | FileCheck -check-prefix=RUN_PASS_NUMBERS %s
+; RUN: ls %t/logs | FileCheck --check-prefix=AFTER2 %s
+; RUN: ls %t/logs | count 1
+; AFTER2: 2-[[MODULE_NAME_HASH:[a-z0-9]+]]-module-NoOpModulePass-after.ll
+
+
+; RUN: cat %t/logs/* | FileCheck -check-prefix=AFTER2_COMMENT %s
+; AFTER2_COMMENT: ; *** IR Dump After 2-NoOpModulePass on [module] ***
+
+
+
+; RUN: rm -rf %t/logs
+; RUN: opt %s -disable-output -passes='no-op-module,no-op-module,no-op-module' -print-after-pass-number=1 -print-pass-numbers -ir-dump-directory %t/logs 2>&1 | FileCheck -check-prefix=RUN_PASS_NUMBERS %s
+; RUN: ls %t/logs | FileCheck --check-prefix=AFTER1 %s
+; RUN: ls %t/logs | count 1
+; AFTER1: 1-[[MODULE_NAME_HASH:[a-z0-9]+]]-module-NoOpModulePass-after.ll
+
+
+; RUN: cat %t/logs/* | FileCheck -check-prefix=AFTER1_COMMENT %s
+; AFTER1_COMMENT: ; *** IR Dump After 1-NoOpModulePass on [module] ***
+
+define void @foo() {
+ ret void
+}
+
+define void @bar() {
+entry:
+ br label %my-loop
+
+my-loop:
+ br label %my-loop
+}
diff --git a/llvm/test/Other/dump-before-after.ll b/llvm/test/Other/dump-before-after.ll
index 2934a77071a75..bfaaffc0a9270 100644
--- a/llvm/test/Other/dump-before-after.ll
+++ b/llvm/test/Other/dump-before-after.ll
@@ -5,8 +5,8 @@
; RUN: opt %s -disable-output -passes='no-op-module' -ir-dump-directory %t/logs -print-after=no-op-module -print-before=no-op-module
; RUN: ls %t/logs | FileCheck %s --check-prefix=SINGLE-PASS
; RUN: ls %t/logs | count 2
-; SINGLE-PASS-DAG: 0-[[MODULE_NAME_HASH:[a-z0-9]+]]-module-NoOpModulePass-after.ll
-; SINGLE-PASS-DAG: 0-[[MODULE_NAME_HASH]]-module-NoOpModulePass-before.ll
+; SINGLE-PASS-DAG: 1-[[MODULE_NAME_HASH:[a-z0-9]+]]-module-NoOpModulePass-after.ll
+; SINGLE-PASS-DAG: 1-[[MODULE_NAME_HASH]]-module-NoOpModulePass-before.ll
; RUN: cat %t/logs/*after.ll | FileCheck %s --check-prefix=SINGLE-PASS-CONTENTS
; SINGLE-PASS-CONTENTS: ; *** IR Dump After NoOpModulePass on [module] ***
@@ -31,12 +31,12 @@
; RUN: opt %s -disable-output -passes='no-op-module,no-op-module,no-op-module' -ir-dump-directory %t/logs -print-after=no-op-module -print-before=no-op-module
; RUN: ls %t/logs | FileCheck %s --check-prefix=MULTIPLE-PASSES
; RUN: ls %t/logs | count 6
-; MULTIPLE-PASSES-DAG: 0-[[MODULE_NAME_HASH:[a-z0-9]+]]-module-NoOpModulePass-after.ll
-; MULTIPLE-PASSES-DAG: 0-[[MODULE_NAME_HASH]]-module-NoOpModulePass-before.ll
-; MULTIPLE-PASSES-DAG: 1-[[MODULE_NAME_HASH]]-module-NoOpModulePass-after.ll
+; MULTIPLE-PASSES-DAG: 1-[[MODULE_NAME_HASH:[a-z0-9]+]]-module-NoOpModulePass-after.ll
; MULTIPLE-PASSES-DAG: 1-[[MODULE_NAME_HASH]]-module-NoOpModulePass-before.ll
; MULTIPLE-PASSES-DAG: 2-[[MODULE_NAME_HASH]]-module-NoOpModulePass-after.ll
; MULTIPLE-PASSES-DAG: 2-[[MODULE_NAME_HASH]]-module-NoOpModulePass-before.ll
+; MULTIPLE-PASSES-DAG: 3-[[MODULE_NAME_HASH]]-module-NoOpModulePass-after.ll
+; MULTIPLE-PASSES-DAG: 3-[[MODULE_NAME_HASH]]-module-NoOpModulePass-before.ll
; RUN: rm -rf %t/logs
; Dump before and after multiple passes, of various levels of granularity
@@ -44,20 +44,20 @@
; RUN: opt %s -disable-output -passes='no-op-module,cgscc(no-op-cgscc),function(no-op-function),function(loop(no-op-loop)),no-op-module' -ir-dump-directory %t/logs -print-after=no-op-module,no-op-cgscc,no-op-function,no-op-loop -print-before=no-op-module,no-op-cgscc,no-op-function,no-op-loop
; RUN: ls %t/logs | FileCheck %s --check-prefix=MULTIPLE-GRANULAR-PASSES
; RUN: ls %t/logs | count 14
-; MULTIPLE-GRANULAR-PASSES-DAG: 0-[[MODULE_NAME_HASH:[a-z0-9]+]]-module-NoOpModulePass-after.ll
-; MULTIPLE-GRANULAR-PASSES-DAG: 0-[[MODULE_NAME_HASH]]-module-NoOpModulePass-before.ll
-; MULTIPLE-GRANULAR-PASSES-DAG: 1-[[MODULE_NAME_HASH]]-scc-[[SCC_FOO_HASH:[a-z0-9]+]]-NoOpCGSCCPass-after.ll
-; MULTIPLE-GRANULAR-PASSES-DAG: 1-[[MODULE_NAME_HASH]]-scc-[[SCC_FOO_HASH]]-NoOpCGSCCPass-before.ll
-; MULTIPLE-GRANULAR-PASSES-DAG: 2-[[MODULE_NAME_HASH]]-scc-[[SCC_BAR_HASH:[a-z0-9]+]]-NoOpCGSCCPass-after.ll
-; MULTIPLE-GRANULAR-PASSES-DAG: 2-[[MODULE_NAME_HASH]]-scc-[[SCC_BAR_HASH]]-NoOpCGSCCPass-before.ll
-; MULTIPLE-GRANULAR-PASSES-DAG: 3-[[MODULE_NAME_HASH]]-function-[[FUNCTION_FOO_HASH:[a-z0-9]+]]-NoOpFunctionPass-after.ll
-; MULTIPLE-GRANULAR-PASSES-DAG: 3-[[MODULE_NAME_HASH]]-function-[[FUNCTION_FOO_HASH]]-NoOpFunctionPass-before.ll
-; MULTIPLE-GRANULAR-PASSES-DAG: 4-[[MODULE_NAME_HASH]]-function-[[FUNCTION_BAR_HASH:[a-z0-9]+]]-NoOpFunctionPass-after.ll
-; MULTIPLE-GRANULAR-PASSES-DAG: 4-[[MODULE_NAME_HASH]]-function-[[FUNCTION_BAR_HASH]]-NoOpFunctionPass-before.ll
-; MULTIPLE-GRANULAR-PASSES-DAG: 9-[[MODULE_NAME_HASH]]-loop-[[LOOP_NAME_HASH:[a-z0-9]+]]-NoOpLoopPass-after.ll
-; MULTIPLE-GRANULAR-PASSES-DAG: 9-[[MODULE_NAME_HASH]]-loop-[[LOOP_NAME_HASH]]-NoOpLoopPass-before.ll
-; MULTIPLE-GRANULAR-PASSES-DAG: 10-[[MODULE_NAME_HASH]]-module-NoOpModulePass-after.ll
-; MULTIPLE-GRANULAR-PASSES-DAG: 10-[[MODULE_NAME_HASH]]-module-NoOpModulePass-before.ll
+; MULTIPLE-GRANULAR-PASSES-DAG: 1-[[MODULE_NAME_HASH:[a-z0-9]+]]-module-NoOpModulePass-after.ll
+; MULTIPLE-GRANULAR-PASSES-DAG: 1-[[MODULE_NAME_HASH]]-module-NoOpModulePass-before.ll
+; MULTIPLE-GRANULAR-PASSES-DAG: 2-[[MODULE_NAME_HASH]]-scc-[[SCC_FOO_HASH:[a-z0-9]+]]-NoOpCGSCCPass-after.ll
+; MULTIPLE-GRANULAR-PASSES-DAG: 2-[[MODULE_NAME_HASH]]-scc-[[SCC_FOO_HASH]]-NoOpCGSCCPass-before.ll
+; MULTIPLE-GRANULAR-PASSES-DAG: 3-[[MODULE_NAME_HASH]]-scc-[[SCC_BAR_HASH:[a-z0-9]+]]-NoOpCGSCCPass-after.ll
+; MULTIPLE-GRANULAR-PASSES-DAG: 3-[[MODULE_NAME_HASH]]-scc-[[SCC_BAR_HASH]]-NoOpCGSCCPass-before.ll
+; MULTIPLE-GRANULAR-PASSES-DAG: 4-[[MODULE_NAME_HASH]]-function-[[FUNCTION_FOO_HASH:[a-z0-9]+]]-NoOpFunctionPass-after.ll
+; MULTIPLE-GRANULAR-PASSES-DAG: 4-[[MODULE_NAME_HASH]]-function-[[FUNCTION_FOO_HASH]]-NoOpFunctionPass-before.ll
+; MULTIPLE-GRANULAR-PASSES-DAG: 5-[[MODULE_NAME_HASH]]-function-[[FUNCTION_BAR_HASH:[a-z0-9]+]]-NoOpFunctionPass-after.ll
+; MULTIPLE-GRANULAR-PASSES-DAG: 5-[[MODULE_NAME_HASH]]-function-[[FUNCTION_BAR_HASH]]-NoOpFunctionPass-before.ll
+; MULTIPLE-GRANULAR-PASSES-DAG: 10-[[MODULE_NAME_HASH]]-loop-[[LOOP_NAME_HASH:[a-z0-9]+]]-NoOpLoopPass-after.ll
+; MULTIPLE-GRANULAR-PASSES-DAG: 10-[[MODULE_NAME_HASH]]-loop-[[LOOP_NAME_HASH]]-NoOpLoopPass-before.ll
+; MULTIPLE-GRANULAR-PASSES-DAG: 11-[[MODULE_NAME_HASH]]-module-NoOpModulePass-after.ll
+; MULTIPLE-GRANULAR-PASSES-DAG: 11-[[MODULE_NAME_HASH]]-module-NoOpModulePass-before.ll
; RUN: rm -rf %t/logs
define void @foo() {
More information about the llvm-commits
mailing list