diff --git a/llvm/include/llvm/Analysis/DemandedBits.h b/llvm/include/llvm/Analysis/DemandedBits.h --- a/llvm/include/llvm/Analysis/DemandedBits.h +++ b/llvm/include/llvm/Analysis/DemandedBits.h @@ -25,7 +25,6 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/IR/PassManager.h" -#include "llvm/Pass.h" #include namespace llvm { @@ -99,26 +98,6 @@ SmallPtrSet DeadUses; }; -class DemandedBitsWrapperPass : public FunctionPass { -private: - mutable std::optional DB; - -public: - static char ID; // Pass identification, replacement for typeid - - DemandedBitsWrapperPass(); - - bool runOnFunction(Function &F) override; - void getAnalysisUsage(AnalysisUsage &AU) const override; - - /// Clean up memory in between runs - void releaseMemory() override; - - DemandedBits &getDemandedBits() { return *DB; } - - void print(raw_ostream &OS, const Module *M) const override; -}; - /// An analysis that produces \c DemandedBits for a function. class DemandedBitsAnalysis : public AnalysisInfoMixin { friend AnalysisInfoMixin; @@ -144,9 +123,6 @@ PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); }; -/// Create a demanded bits analysis pass. -FunctionPass *createDemandedBitsWrapperPass(); - } // end namespace llvm #endif // LLVM_ANALYSIS_DEMANDEDBITS_H diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h --- a/llvm/include/llvm/InitializePasses.h +++ b/llvm/include/llvm/InitializePasses.h @@ -102,7 +102,6 @@ void initializeDeadMachineInstructionElimPass(PassRegistry&); void initializeDebugifyMachineModulePass(PassRegistry &); void initializeDelinearizationPass(PassRegistry&); -void initializeDemandedBitsWrapperPassPass(PassRegistry&); void initializeDependenceAnalysisWrapperPassPass(PassRegistry&); void initializeDetectDeadLanesPass(PassRegistry&); void initializeDomOnlyPrinterWrapperPassPass(PassRegistry &); diff --git a/llvm/lib/Analysis/Analysis.cpp b/llvm/lib/Analysis/Analysis.cpp --- a/llvm/lib/Analysis/Analysis.cpp +++ b/llvm/lib/Analysis/Analysis.cpp @@ -34,7 +34,6 @@ initializeCycleInfoWrapperPassPass(Registry); initializeDependenceAnalysisWrapperPassPass(Registry); initializeDelinearizationPass(Registry); - initializeDemandedBitsWrapperPassPass(Registry); initializeDominanceFrontierWrapperPassPass(Registry); initializeDomViewerWrapperPassPass(Registry); initializeDomPrinterWrapperPassPass(Registry); diff --git a/llvm/lib/Analysis/DemandedBits.cpp b/llvm/lib/Analysis/DemandedBits.cpp --- a/llvm/lib/Analysis/DemandedBits.cpp +++ b/llvm/lib/Analysis/DemandedBits.cpp @@ -34,8 +34,6 @@ #include "llvm/IR/PatternMatch.h" #include "llvm/IR/Type.h" #include "llvm/IR/Use.h" -#include "llvm/InitializePasses.h" -#include "llvm/Pass.h" #include "llvm/Support/Casting.h" #include "llvm/Support/Debug.h" #include "llvm/Support/KnownBits.h" @@ -48,30 +46,6 @@ #define DEBUG_TYPE "demanded-bits" -char DemandedBitsWrapperPass::ID = 0; - -INITIALIZE_PASS_BEGIN(DemandedBitsWrapperPass, "demanded-bits", - "Demanded bits analysis", false, false) -INITIALIZE_PASS_DEPENDENCY(AssumptionCacheTracker) -INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass) -INITIALIZE_PASS_END(DemandedBitsWrapperPass, "demanded-bits", - "Demanded bits analysis", false, false) - -DemandedBitsWrapperPass::DemandedBitsWrapperPass() : FunctionPass(ID) { - initializeDemandedBitsWrapperPassPass(*PassRegistry::getPassRegistry()); -} - -void DemandedBitsWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const { - AU.setPreservesCFG(); - AU.addRequired(); - AU.addRequired(); - AU.setPreservesAll(); -} - -void DemandedBitsWrapperPass::print(raw_ostream &OS, const Module *M) const { - DB->print(OS); -} - static bool isAlwaysLive(Instruction *I) { return I->isTerminator() || isa(I) || I->isEHPad() || I->mayHaveSideEffects(); @@ -310,17 +284,6 @@ } } -bool DemandedBitsWrapperPass::runOnFunction(Function &F) { - auto &AC = getAnalysis().getAssumptionCache(F); - auto &DT = getAnalysis().getDomTree(); - DB.emplace(F, AC, DT); - return false; -} - -void DemandedBitsWrapperPass::releaseMemory() { - DB.reset(); -} - void DemandedBits::performAnalysis() { if (Analyzed) // Analysis already completed for this function. @@ -605,10 +568,6 @@ true); } -FunctionPass *llvm::createDemandedBitsWrapperPass() { - return new DemandedBitsWrapperPass(); -} - AnalysisKey DemandedBitsAnalysis::Key; DemandedBits DemandedBitsAnalysis::run(Function &F, diff --git a/llvm/lib/CodeGen/ReplaceWithVeclib.cpp b/llvm/lib/CodeGen/ReplaceWithVeclib.cpp --- a/llvm/lib/CodeGen/ReplaceWithVeclib.cpp +++ b/llvm/lib/CodeGen/ReplaceWithVeclib.cpp @@ -230,7 +230,6 @@ AU.addPreserved(); AU.addPreserved(); AU.addPreserved(); - AU.addPreserved(); AU.addPreserved(); AU.addPreserved(); } diff --git a/llvm/lib/Transforms/Utils/InjectTLIMappings.cpp b/llvm/lib/Transforms/Utils/InjectTLIMappings.cpp --- a/llvm/lib/Transforms/Utils/InjectTLIMappings.cpp +++ b/llvm/lib/Transforms/Utils/InjectTLIMappings.cpp @@ -159,7 +159,6 @@ AU.addPreserved(); AU.addPreserved(); AU.addPreserved(); - AU.addPreserved(); AU.addPreserved(); AU.addPreserved(); }