-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
[NewPM] Remove CFGPrinterLegacyPass #73414
[NewPM] Remove CFGPrinterLegacyPass #73414
Conversation
@llvm/pr-subscribers-llvm-analysis Author: Aiden Grossman (boomanaiden154) ChangesThis pass has no test coverage in upstream LLVM, is not used anywhere in upstream LLVM, and has a NewPM equivalent. For these reasons, remove it. Full diff: https://github.com/llvm/llvm-project/pull/73414.diff 4 Files Affected:
diff --git a/llvm/include/llvm/Analysis/CFGPrinter.h b/llvm/include/llvm/Analysis/CFGPrinter.h
index 884dd857c82b180..e12bd7bc45b796f 100644
--- a/llvm/include/llvm/Analysis/CFGPrinter.h
+++ b/llvm/include/llvm/Analysis/CFGPrinter.h
@@ -344,7 +344,6 @@ struct DOTGraphTraits<DOTFuncInfo *> : public DefaultDOTGraphTraits {
namespace llvm {
class FunctionPass;
-FunctionPass *createCFGPrinterLegacyPassPass();
FunctionPass *createCFGOnlyPrinterLegacyPassPass();
} // End llvm namespace
diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h
index 05122ea98d8ca52..6c79544a4f83ec1 100644
--- a/llvm/include/llvm/InitializePasses.h
+++ b/llvm/include/llvm/InitializePasses.h
@@ -67,7 +67,6 @@ void initializeBreakFalseDepsPass(PassRegistry&);
void initializeCanonicalizeFreezeInLoopsPass(PassRegistry &);
void initializeCFGOnlyPrinterLegacyPassPass(PassRegistry&);
void initializeCFGOnlyViewerLegacyPassPass(PassRegistry&);
-void initializeCFGPrinterLegacyPassPass(PassRegistry&);
void initializeCFGSimplifyPassPass(PassRegistry&);
void initializeCFGuardPass(PassRegistry&);
void initializeCFGuardLongjmpPass(PassRegistry&);
diff --git a/llvm/lib/Analysis/Analysis.cpp b/llvm/lib/Analysis/Analysis.cpp
index 1fa14b005d37609..2876c3b8823bb17 100644
--- a/llvm/lib/Analysis/Analysis.cpp
+++ b/llvm/lib/Analysis/Analysis.cpp
@@ -26,7 +26,6 @@ void llvm::initializeAnalysis(PassRegistry &Registry) {
initializeCallGraphPrinterLegacyPassPass(Registry);
initializeCallGraphViewerPass(Registry);
initializeCFGViewerLegacyPassPass(Registry);
- initializeCFGPrinterLegacyPassPass(Registry);
initializeCFGOnlyViewerLegacyPassPass(Registry);
initializeCFGOnlyPrinterLegacyPassPass(Registry);
initializeCycleInfoWrapperPassPass(Registry);
diff --git a/llvm/lib/Analysis/CFGPrinter.cpp b/llvm/lib/Analysis/CFGPrinter.cpp
index 9f55371f259b2cf..5f5ec8ab1eb136d 100644
--- a/llvm/lib/Analysis/CFGPrinter.cpp
+++ b/llvm/lib/Analysis/CFGPrinter.cpp
@@ -173,37 +173,6 @@ PreservedAnalyses CFGOnlyViewerPass::run(Function &F,
return PreservedAnalyses::all();
}
-namespace {
-struct CFGPrinterLegacyPass : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- CFGPrinterLegacyPass() : FunctionPass(ID) {
- initializeCFGPrinterLegacyPassPass(*PassRegistry::getPassRegistry());
- }
-
- bool runOnFunction(Function &F) override {
- if (!CFGFuncName.empty() && !F.getName().contains(CFGFuncName))
- return false;
- auto *BPI = &getAnalysis<BranchProbabilityInfoWrapperPass>().getBPI();
- auto *BFI = &getAnalysis<BlockFrequencyInfoWrapperPass>().getBFI();
- writeCFGToDotFile(F, BFI, BPI, getMaxFreq(F, BFI));
- return false;
- }
-
- void print(raw_ostream &OS, const Module * = nullptr) const override {}
-
- void getAnalysisUsage(AnalysisUsage &AU) const override {
- FunctionPass::getAnalysisUsage(AU);
- AU.addRequired<BlockFrequencyInfoWrapperPass>();
- AU.addRequired<BranchProbabilityInfoWrapperPass>();
- AU.setPreservesAll();
- }
-};
-} // namespace
-
-char CFGPrinterLegacyPass::ID = 0;
-INITIALIZE_PASS(CFGPrinterLegacyPass, "dot-cfg",
- "Print CFG of function to 'dot' file", false, true)
-
PreservedAnalyses CFGPrinterPass::run(Function &F,
FunctionAnalysisManager &AM) {
if (!CFGFuncName.empty() && !F.getName().contains(CFGFuncName))
@@ -282,10 +251,6 @@ void Function::viewCFGOnly(const BlockFrequencyInfo *BFI,
viewCFG(true, BFI, BPI);
}
-FunctionPass *llvm::createCFGPrinterLegacyPassPass() {
- return new CFGPrinterLegacyPass();
-}
-
FunctionPass *llvm::createCFGOnlyPrinterLegacyPassPass() {
return new CFGOnlyPrinterLegacyPass();
}
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
This pass has no test coverage in upstream LLVM, is not used anywhere in upstream LLVM, and has a NewPM equivalent. For these reasons, remove it.
55e97c5
to
dcfe328
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Local branch amd-gfx 7bc40bb Merged main:1449b349ac40 into amd-gfx:ba7e2d1a3aa2 Remote branch main 9ba74c2 [NewPM] Remove CFGPrinterLegacyPass (llvm#73414)
This reverts commit 9ba74c2. Continue to support CFGPrinterLegacyPass for LGC, until it has been converted to new pass manager. Change-Id: I147a44afa8a011bbed28490de1f4dfb564c2fb58
Local branch amd-gfx 2b56631 Revert "[NewPM] Remove CFGPrinterLegacyPass (llvm#73414)" Remote branch main 6318dd8 [mlir] Fix a warning
This pass has no test coverage in upstream LLVM, is not used anywhere in upstream LLVM, and has a NewPM equivalent. For these reasons, remove it.