[llvm] a694225 - [LegacyPM] Remove NameAnonGlobalLegacyPass
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 17 14:38:33 PDT 2022
Author: Fangrui Song
Date: 2022-07-17T14:38:29-07:00
New Revision: a6942256caeb85958409da1d606ddad1c2e44b0b
URL: https://github.com/llvm/llvm-project/commit/a6942256caeb85958409da1d606ddad1c2e44b0b
DIFF: https://github.com/llvm/llvm-project/commit/a6942256caeb85958409da1d606ddad1c2e44b0b.diff
LOG: [LegacyPM] Remove NameAnonGlobalLegacyPass
Unused after LTO removal from optimization passline.
Added:
Modified:
llvm/include/llvm/InitializePasses.h
llvm/include/llvm/Transforms/Scalar.h
llvm/lib/Transforms/Utils/NameAnonGlobals.cpp
llvm/lib/Transforms/Utils/Utils.cpp
llvm/test/Bitcode/thinlto-function-summary.ll
Removed:
################################################################################
diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h
index a605b7e25b6f0..5260762b3437c 100644
--- a/llvm/include/llvm/InitializePasses.h
+++ b/llvm/include/llvm/InitializePasses.h
@@ -317,7 +317,6 @@ void initializeModuleSummaryIndexWrapperPassPass(PassRegistry&);
void initializeModuloScheduleTestPass(PassRegistry&);
void initializeMustExecutePrinterPass(PassRegistry&);
void initializeMustBeExecutedContextPrinterPass(PassRegistry&);
-void initializeNameAnonGlobalLegacyPassPass(PassRegistry&);
void initializeNaryReassociateLegacyPassPass(PassRegistry&);
void initializeNewGVNLegacyPassPass(PassRegistry&);
void initializeObjCARCAAWrapperPassPass(PassRegistry&);
diff --git a/llvm/include/llvm/Transforms/Scalar.h b/llvm/include/llvm/Transforms/Scalar.h
index dbc4270e03675..5f852963c687d 100644
--- a/llvm/include/llvm/Transforms/Scalar.h
+++ b/llvm/include/llvm/Transforms/Scalar.h
@@ -521,9 +521,6 @@ FunctionPass *createLoopVersioningPass();
//
FunctionPass *createLoopDataPrefetchPass();
-///===---------------------------------------------------------------------===//
-ModulePass *createNameAnonGlobalPass();
-
//===----------------------------------------------------------------------===//
//
// LibCallsShrinkWrap - Shrink-wraps a call to function if the result is not
diff --git a/llvm/lib/Transforms/Utils/NameAnonGlobals.cpp b/llvm/lib/Transforms/Utils/NameAnonGlobals.cpp
index deaee467531d9..d4ab4504064f3 100644
--- a/llvm/lib/Transforms/Utils/NameAnonGlobals.cpp
+++ b/llvm/lib/Transforms/Utils/NameAnonGlobals.cpp
@@ -81,26 +81,6 @@ bool llvm::nameUnamedGlobals(Module &M) {
return Changed;
}
-namespace {
-
-// Legacy pass that provides a name to every anon globals.
-class NameAnonGlobalLegacyPass : public ModulePass {
-
-public:
- /// Pass identification, replacement for typeid
- static char ID;
-
- /// Specify pass name for debug output
- StringRef getPassName() const override { return "Name Anon Globals"; }
-
- explicit NameAnonGlobalLegacyPass() : ModulePass(ID) {}
-
- bool runOnModule(Module &M) override { return nameUnamedGlobals(M); }
-};
-char NameAnonGlobalLegacyPass::ID = 0;
-
-} // anonymous namespace
-
PreservedAnalyses NameAnonGlobalPass::run(Module &M,
ModuleAnalysisManager &AM) {
if (!nameUnamedGlobals(M))
@@ -108,14 +88,3 @@ PreservedAnalyses NameAnonGlobalPass::run(Module &M,
return PreservedAnalyses::none();
}
-
-INITIALIZE_PASS_BEGIN(NameAnonGlobalLegacyPass, "name-anon-globals",
- "Provide a name to nameless globals", false, false)
-INITIALIZE_PASS_END(NameAnonGlobalLegacyPass, "name-anon-globals",
- "Provide a name to nameless globals", false, false)
-
-namespace llvm {
-ModulePass *createNameAnonGlobalPass() {
- return new NameAnonGlobalLegacyPass();
-}
-}
diff --git a/llvm/lib/Transforms/Utils/Utils.cpp b/llvm/lib/Transforms/Utils/Utils.cpp
index cc822a0bf7b62..d002922cfd306 100644
--- a/llvm/lib/Transforms/Utils/Utils.cpp
+++ b/llvm/lib/Transforms/Utils/Utils.cpp
@@ -36,7 +36,6 @@ void llvm::initializeTransformUtils(PassRegistry &Registry) {
initializeLowerGlobalDtorsLegacyPassPass(Registry);
initializeLowerInvokeLegacyPassPass(Registry);
initializeLowerSwitchLegacyPassPass(Registry);
- initializeNameAnonGlobalLegacyPassPass(Registry);
initializePromoteLegacyPassPass(Registry);
initializeStripNonLineTableDebugLegacyPassPass(Registry);
initializeUnifyFunctionExitNodesLegacyPassPass(Registry);
diff --git a/llvm/test/Bitcode/thinlto-function-summary.ll b/llvm/test/Bitcode/thinlto-function-summary.ll
index c9a64018f9d89..ad745dd826acd 100644
--- a/llvm/test/Bitcode/thinlto-function-summary.ll
+++ b/llvm/test/Bitcode/thinlto-function-summary.ll
@@ -1,4 +1,3 @@
-; RUN: opt -name-anon-globals -module-summary < %s | llvm-bcanalyzer -dump | FileCheck %s -check-prefix=BC
; RUN: opt -passes=name-anon-globals -module-summary < %s | llvm-bcanalyzer -dump | FileCheck %s -check-prefix=BC
; Check for summary block/records.
@@ -31,7 +30,7 @@
; BC-NEXT: blob data = 'hfoobaranon.{{................................}}.0variadicllvm.va_startf{{.*}}'
-; RUN: opt -name-anon-globals -module-summary < %s | llvm-dis | FileCheck %s
+; RUN: opt -passes=name-anon-globals -module-summary < %s | llvm-dis | FileCheck %s
; Check that this round-trips correctly.
; ModuleID = '<stdin>'
More information about the llvm-commits
mailing list