[llvm] [opt][NewPM] Add isRequired to passes named *VerifierPass (PR #76517)
Björn Pettersson via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 28 09:35:38 PST 2023
https://github.com/bjope created https://github.com/llvm/llvm-project/pull/76517
In this patch all passes named as *VerifierPass are being marked as required. That should make sure that the passes are executed without being skipped due to standard instrumentations.
For example
opt -passes='verify<loops>,verify<scalar-evolution>' ...
will no longer skip running the verifications for functions marked as optnone.
>From 13868f3c1451fc0d95f8973e1539c56d2c4b9841 Mon Sep 17 00:00:00 2001
From: Bjorn Pettersson <bjorn.a.pettersson at ericsson.com>
Date: Thu, 28 Dec 2023 15:51:55 +0100
Subject: [PATCH] [opt][NewPM] Add isRequired to passes named *VerifierPass
In this patch I add mark all passes named as *VerifierPass
as being required. That should make sure that the passes are
executed without being skipped due to standard instrumentations.
So for example
opt -passes='verify<loops>,verify<scalar-evolution>' ...
will no longer skip running the verificationsfor functions
marked as optnone.
---
llvm/include/llvm/Analysis/LoopInfo.h | 1 +
llvm/include/llvm/Analysis/MemorySSA.h | 1 +
llvm/include/llvm/Analysis/RegionInfo.h | 1 +
llvm/include/llvm/Analysis/ScalarEvolution.h | 1 +
llvm/include/llvm/IR/Dominators.h | 1 +
llvm/include/llvm/IR/SafepointIRVerifier.h | 2 ++
llvm/include/llvm/Transforms/Utils/PredicateInfo.h | 1 +
7 files changed, 8 insertions(+)
diff --git a/llvm/include/llvm/Analysis/LoopInfo.h b/llvm/include/llvm/Analysis/LoopInfo.h
index 3b106381fbca3a..c5e08ff7169e7d 100644
--- a/llvm/include/llvm/Analysis/LoopInfo.h
+++ b/llvm/include/llvm/Analysis/LoopInfo.h
@@ -585,6 +585,7 @@ class LoopPrinterPass : public PassInfoMixin<LoopPrinterPass> {
/// Verifier pass for the \c LoopAnalysis results.
struct LoopVerifierPass : public PassInfoMixin<LoopVerifierPass> {
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
+ static bool isRequired() { return true; }
};
/// The legacy pass manager's analysis pass to compute loop information.
diff --git a/llvm/include/llvm/Analysis/MemorySSA.h b/llvm/include/llvm/Analysis/MemorySSA.h
index 94d7f1a78b8470..3dd1790ea3c677 100644
--- a/llvm/include/llvm/Analysis/MemorySSA.h
+++ b/llvm/include/llvm/Analysis/MemorySSA.h
@@ -969,6 +969,7 @@ class MemorySSAWalkerPrinterPass
/// Verifier pass for \c MemorySSA.
struct MemorySSAVerifierPass : PassInfoMixin<MemorySSAVerifierPass> {
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
+ static bool isRequired() { return true; }
};
/// Legacy analysis pass which computes \c MemorySSA.
diff --git a/llvm/include/llvm/Analysis/RegionInfo.h b/llvm/include/llvm/Analysis/RegionInfo.h
index 612b977f1ffa45..eac43316051dbe 100644
--- a/llvm/include/llvm/Analysis/RegionInfo.h
+++ b/llvm/include/llvm/Analysis/RegionInfo.h
@@ -988,6 +988,7 @@ class RegionInfoPrinterPass : public PassInfoMixin<RegionInfoPrinterPass> {
/// Verifier pass for the \c RegionInfo.
struct RegionInfoVerifierPass : PassInfoMixin<RegionInfoVerifierPass> {
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
+ static bool isRequired() { return true; }
};
template <>
diff --git a/llvm/include/llvm/Analysis/ScalarEvolution.h b/llvm/include/llvm/Analysis/ScalarEvolution.h
index 4f1237c4b1f92b..9dba5e1407294b 100644
--- a/llvm/include/llvm/Analysis/ScalarEvolution.h
+++ b/llvm/include/llvm/Analysis/ScalarEvolution.h
@@ -2246,6 +2246,7 @@ class ScalarEvolutionVerifierPass
: public PassInfoMixin<ScalarEvolutionVerifierPass> {
public:
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
+ static bool isRequired() { return true; }
};
/// Printer pass for the \c ScalarEvolutionAnalysis results.
diff --git a/llvm/include/llvm/IR/Dominators.h b/llvm/include/llvm/IR/Dominators.h
index 8784a425d2841a..19a1e117ccaa00 100644
--- a/llvm/include/llvm/IR/Dominators.h
+++ b/llvm/include/llvm/IR/Dominators.h
@@ -298,6 +298,7 @@ class DominatorTreePrinterPass
/// Verifier pass for the \c DominatorTree.
struct DominatorTreeVerifierPass : PassInfoMixin<DominatorTreeVerifierPass> {
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
+ static bool isRequired() { return true; }
};
/// Enables verification of dominator trees.
diff --git a/llvm/include/llvm/IR/SafepointIRVerifier.h b/llvm/include/llvm/IR/SafepointIRVerifier.h
index 246d236adb389a..2ee998e4c68ffe 100644
--- a/llvm/include/llvm/IR/SafepointIRVerifier.h
+++ b/llvm/include/llvm/IR/SafepointIRVerifier.h
@@ -40,6 +40,8 @@ class SafepointIRVerifierPass : public PassInfoMixin<SafepointIRVerifierPass> {
explicit SafepointIRVerifierPass() = default;
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
+
+ static bool isRequired() { return true; }
};
}
diff --git a/llvm/include/llvm/Transforms/Utils/PredicateInfo.h b/llvm/include/llvm/Transforms/Utils/PredicateInfo.h
index b433d2ec89dc0e..9da7c7bbc5bc44 100644
--- a/llvm/include/llvm/Transforms/Utils/PredicateInfo.h
+++ b/llvm/include/llvm/Transforms/Utils/PredicateInfo.h
@@ -220,6 +220,7 @@ class PredicateInfoPrinterPass
/// Verifier pass for \c PredicateInfo.
struct PredicateInfoVerifierPass : PassInfoMixin<PredicateInfoVerifierPass> {
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
+ static bool isRequired() { return true; }
};
} // end namespace llvm
More information about the llvm-commits
mailing list