[llvm] d715e2c - [NewPM] Remove GuardWideningLegacyPass (#72810)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 20 00:59:29 PST 2023
Author: Aiden Grossman
Date: 2023-11-20T00:59:25-08:00
New Revision: d715e2c65b4449f00b39493b1e0a19c04b75bc7c
URL: https://github.com/llvm/llvm-project/commit/d715e2c65b4449f00b39493b1e0a19c04b75bc7c
DIFF: https://github.com/llvm/llvm-project/commit/d715e2c65b4449f00b39493b1e0a19c04b75bc7c.diff
LOG: [NewPM] Remove GuardWideningLegacyPass (#72810)
This legacy pass isn't used anywhere and there is no test coverage, so
at this point it should be removed.
Added:
Modified:
llvm/include/llvm/InitializePasses.h
llvm/include/llvm/LinkAllPasses.h
llvm/include/llvm/Transforms/Scalar.h
llvm/lib/Transforms/Scalar/GuardWidening.cpp
llvm/lib/Transforms/Scalar/Scalar.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h
index da38a38b87ebc4d..efd82a260f6fb9d 100644
--- a/llvm/include/llvm/InitializePasses.h
+++ b/llvm/include/llvm/InitializePasses.h
@@ -129,8 +129,7 @@ void initializeGCMachineCodeAnalysisPass(PassRegistry&);
void initializeGCModuleInfoPass(PassRegistry&);
void initializeGVNLegacyPassPass(PassRegistry&);
void initializeGlobalMergePass(PassRegistry&);
-void initializeGlobalsAAWrapperPassPass(PassRegistry&);
-void initializeGuardWideningLegacyPassPass(PassRegistry&);
+void initializeGlobalsAAWrapperPassPass(PassRegistry &);
void initializeHardwareLoopsLegacyPass(PassRegistry&);
void initializeMIRProfileLoaderPassPass(PassRegistry &);
void initializeIRSimilarityIdentifierWrapperPassPass(PassRegistry&);
diff --git a/llvm/include/llvm/LinkAllPasses.h b/llvm/include/llvm/LinkAllPasses.h
index 3fc90e85c3533e2..91ca10d4c183cce 100644
--- a/llvm/include/llvm/LinkAllPasses.h
+++ b/llvm/include/llvm/LinkAllPasses.h
@@ -80,7 +80,6 @@ namespace {
(void) llvm::createDomViewerWrapperPassPass();
(void) llvm::createAlwaysInlinerLegacyPass();
(void) llvm::createGlobalsAAWrapperPass();
- (void) llvm::createGuardWideningPass();
(void) llvm::createLoopGuardWideningPass();
(void) llvm::createInstSimplifyLegacyPass();
(void) llvm::createInstructionCombiningPass();
diff --git a/llvm/include/llvm/Transforms/Scalar.h b/llvm/include/llvm/Transforms/Scalar.h
index 0676f485f3fbcf4..cf29eadbd049206 100644
--- a/llvm/include/llvm/Transforms/Scalar.h
+++ b/llvm/include/llvm/Transforms/Scalar.h
@@ -39,16 +39,6 @@ Pass *createRedundantDbgInstEliminationPass();
//
FunctionPass *createDeadCodeEliminationPass();
-
-//===----------------------------------------------------------------------===//
-//
-// GuardWidening - An optimization over the @llvm.experimental.guard intrinsic
-// that (optimistically) combines multiple guards into one to have fewer checks
-// at runtime.
-//
-FunctionPass *createGuardWideningPass();
-
-
//===----------------------------------------------------------------------===//
//
// LoopGuardWidening - Analogous to the GuardWidening pass, but restricted to a
diff --git a/llvm/lib/Transforms/Scalar/GuardWidening.cpp b/llvm/lib/Transforms/Scalar/GuardWidening.cpp
index e6eccb4fbafd3e1..0dd99f45f670d13 100644
--- a/llvm/lib/Transforms/Scalar/GuardWidening.cpp
+++ b/llvm/lib/Transforms/Scalar/GuardWidening.cpp
@@ -1015,40 +1015,7 @@ PreservedAnalyses GuardWideningPass::run(Loop &L, LoopAnalysisManager &AM,
}
namespace {
-struct GuardWideningLegacyPass : public FunctionPass {
- static char ID;
-
- GuardWideningLegacyPass() : FunctionPass(ID) {
- initializeGuardWideningLegacyPassPass(*PassRegistry::getPassRegistry());
- }
-
- bool runOnFunction(Function &F) override {
- if (skipFunction(F))
- return false;
- auto &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
- auto &LI = getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
- auto &AC = getAnalysis<AssumptionCacheTracker>().getAssumptionCache(F);
- auto &PDT = getAnalysis<PostDominatorTreeWrapperPass>().getPostDomTree();
- auto *MSSAWP = getAnalysisIfAvailable<MemorySSAWrapperPass>();
- std::unique_ptr<MemorySSAUpdater> MSSAU;
- if (MSSAWP)
- MSSAU = std::make_unique<MemorySSAUpdater>(&MSSAWP->getMSSA());
- return GuardWideningImpl(DT, &PDT, LI, AC, MSSAU ? MSSAU.get() : nullptr,
- DT.getRootNode(),
- [](BasicBlock *) { return true; })
- .run();
- }
-
- void getAnalysisUsage(AnalysisUsage &AU) const override {
- AU.setPreservesCFG();
- AU.addRequired<DominatorTreeWrapperPass>();
- AU.addRequired<PostDominatorTreeWrapperPass>();
- AU.addRequired<LoopInfoWrapperPass>();
- AU.addPreserved<MemorySSAWrapperPass>();
- }
-};
-
-/// Same as above, but restricted to a single loop at a time. Can be
+/// Restricted to a single loop at a time. Can be
/// scheduled with other loop passes w/o breaking out of LPM
struct LoopGuardWideningLegacyPass : public LoopPass {
static char ID;
@@ -1091,17 +1058,8 @@ struct LoopGuardWideningLegacyPass : public LoopPass {
};
}
-char GuardWideningLegacyPass::ID = 0;
char LoopGuardWideningLegacyPass::ID = 0;
-INITIALIZE_PASS_BEGIN(GuardWideningLegacyPass, "guard-widening", "Widen guards",
- false, false)
-INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
-INITIALIZE_PASS_DEPENDENCY(PostDominatorTreeWrapperPass)
-INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass)
-INITIALIZE_PASS_END(GuardWideningLegacyPass, "guard-widening", "Widen guards",
- false, false)
-
INITIALIZE_PASS_BEGIN(LoopGuardWideningLegacyPass, "loop-guard-widening",
"Widen guards (within a single loop, as a loop pass)",
false, false)
@@ -1112,10 +1070,6 @@ INITIALIZE_PASS_END(LoopGuardWideningLegacyPass, "loop-guard-widening",
"Widen guards (within a single loop, as a loop pass)",
false, false)
-FunctionPass *llvm::createGuardWideningPass() {
- return new GuardWideningLegacyPass();
-}
-
Pass *llvm::createLoopGuardWideningPass() {
return new LoopGuardWideningLegacyPass();
}
diff --git a/llvm/lib/Transforms/Scalar/Scalar.cpp b/llvm/lib/Transforms/Scalar/Scalar.cpp
index 11bb8e936b74e7c..df402f260a1f64b 100644
--- a/llvm/lib/Transforms/Scalar/Scalar.cpp
+++ b/llvm/lib/Transforms/Scalar/Scalar.cpp
@@ -22,7 +22,6 @@ void llvm::initializeScalarOpts(PassRegistry &Registry) {
initializeConstantHoistingLegacyPassPass(Registry);
initializeDCELegacyPassPass(Registry);
initializeScalarizerLegacyPassPass(Registry);
- initializeGuardWideningLegacyPassPass(Registry);
initializeLoopGuardWideningLegacyPassPass(Registry);
initializeGVNLegacyPassPass(Registry);
initializeEarlyCSELegacyPassPass(Registry);
More information about the llvm-commits
mailing list