Skip to content

PassManager: disable verification of analysis with -sil-verify-none #42108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions include/swift/SILOptimizer/PassManager/PassManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,7 @@ class SILPassManager {
~SILPassManager();

/// Verify all analyses.
void verifyAnalyses() const {
for (auto *A : Analyses) {
A->verify();
}
}
void verifyAnalyses() const;

/// Precompute all analyses.
void forcePrecomputeAnalyses(SILFunction *F) {
Expand All @@ -348,11 +344,7 @@ class SILPassManager {
/// Discussion: We leave it up to the analyses to decide how to implement
/// this. If no override is provided the SILAnalysis should just call the
/// normal verify method.
void verifyAnalyses(SILFunction *F) const {
for (auto *A : Analyses) {
A->verify(F);
}
}
void verifyAnalyses(SILFunction *F) const;

void executePassPipelinePlan(const SILPassPipelinePlan &Plan);

Expand Down
18 changes: 18 additions & 0 deletions lib/SILOptimizer/PassManager/PassManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,24 @@ void SILPassManager::runModulePass(unsigned TransIdx) {
}
}

void SILPassManager::verifyAnalyses() const {
if (Mod->getOptions().VerifyNone)
return;

for (auto *A : Analyses) {
A->verify();
}
}

void SILPassManager::verifyAnalyses(SILFunction *F) const {
if (Mod->getOptions().VerifyNone)
return;

for (auto *A : Analyses) {
A->verify(F);
}
}

void SILPassManager::executePassPipelinePlan(const SILPassPipelinePlan &Plan) {
for (const SILPassPipeline &Pipeline : Plan.getPipelines()) {
setStageName(Pipeline.Name);
Expand Down