Index: llvm/include/llvm/InitializePasses.h =================================================================== --- llvm/include/llvm/InitializePasses.h +++ llvm/include/llvm/InitializePasses.h @@ -61,8 +61,6 @@ void initializeAnnotationRemarksLegacyPass(PassRegistry &); void initializeAssumptionCacheTrackerPass(PassRegistry&); void initializeAtomicExpandPass(PassRegistry&); -void initializeAttributorLegacyPassPass(PassRegistry&); -void initializeAttributorCGSCCLegacyPassPass(PassRegistry &); void initializeBasicBlockSectionsProfileReaderPass(PassRegistry &); void initializeBasicBlockSectionsPass(PassRegistry &); void initializeBDCELegacyPassPass(PassRegistry&); Index: llvm/include/llvm/LinkAllPasses.h =================================================================== --- llvm/include/llvm/LinkAllPasses.h +++ llvm/include/llvm/LinkAllPasses.h @@ -175,8 +175,6 @@ (void) llvm::createPostDomTree(); (void) llvm::createInstructionNamerPass(); (void) llvm::createMetaRenamerPass(); - (void) llvm::createAttributorLegacyPass(); - (void) llvm::createAttributorCGSCCLegacyPass(); (void) llvm::createPostOrderFunctionAttrsLegacyPass(); (void) llvm::createReversePostOrderFunctionAttrsPass(); (void) llvm::createMergeFunctionsPass(); Index: llvm/include/llvm/Transforms/IPO/Attributor.h =================================================================== --- llvm/include/llvm/Transforms/IPO/Attributor.h +++ llvm/include/llvm/Transforms/IPO/Attributor.h @@ -3120,9 +3120,6 @@ LazyCallGraph &CG, CGSCCUpdateResult &UR); }; -Pass *createAttributorLegacyPass(); -Pass *createAttributorCGSCCLegacyPass(); - /// Helper function to clamp a state \p S of type \p StateType with the /// information in \p R and indicate/return if \p S did change (as-in update is /// required to be run again). Index: llvm/lib/Transforms/IPO/Attributor.cpp =================================================================== --- llvm/lib/Transforms/IPO/Attributor.cpp +++ llvm/lib/Transforms/IPO/Attributor.cpp @@ -3501,98 +3501,3 @@ }; } // end namespace llvm - -namespace { - -struct AttributorLegacyPass : public ModulePass { - static char ID; - - AttributorLegacyPass() : ModulePass(ID) { - initializeAttributorLegacyPassPass(*PassRegistry::getPassRegistry()); - } - - bool runOnModule(Module &M) override { - if (skipModule(M)) - return false; - - AnalysisGetter AG; - SetVector Functions; - for (Function &F : M) - Functions.insert(&F); - - CallGraphUpdater CGUpdater; - BumpPtrAllocator Allocator; - InformationCache InfoCache(M, AG, Allocator, /* CGSCC */ nullptr); - return runAttributorOnFunctions(InfoCache, Functions, AG, CGUpdater, - /* DeleteFns*/ true, - /* IsModulePass */ true); - } - - void getAnalysisUsage(AnalysisUsage &AU) const override { - // FIXME: Think about passes we will preserve and add them here. - AU.addRequired(); - } -}; - -struct AttributorCGSCCLegacyPass : public CallGraphSCCPass { - static char ID; - - AttributorCGSCCLegacyPass() : CallGraphSCCPass(ID) { - initializeAttributorCGSCCLegacyPassPass(*PassRegistry::getPassRegistry()); - } - - bool runOnSCC(CallGraphSCC &SCC) override { - if (skipSCC(SCC)) - return false; - - SetVector Functions; - for (CallGraphNode *CGN : SCC) - if (Function *Fn = CGN->getFunction()) - if (!Fn->isDeclaration()) - Functions.insert(Fn); - - if (Functions.empty()) - return false; - - AnalysisGetter AG; - CallGraph &CG = const_cast(SCC.getCallGraph()); - CallGraphUpdater CGUpdater; - CGUpdater.initialize(CG, SCC); - Module &M = *Functions.back()->getParent(); - BumpPtrAllocator Allocator; - InformationCache InfoCache(M, AG, Allocator, /* CGSCC */ &Functions); - return runAttributorOnFunctions(InfoCache, Functions, AG, CGUpdater, - /* DeleteFns */ false, - /* IsModulePass */ false); - } - - void getAnalysisUsage(AnalysisUsage &AU) const override { - // FIXME: Think about passes we will preserve and add them here. - AU.addRequired(); - CallGraphSCCPass::getAnalysisUsage(AU); - } -}; - -} // end anonymous namespace - -Pass *llvm::createAttributorLegacyPass() { return new AttributorLegacyPass(); } -Pass *llvm::createAttributorCGSCCLegacyPass() { - return new AttributorCGSCCLegacyPass(); -} - -char AttributorLegacyPass::ID = 0; -char AttributorCGSCCLegacyPass::ID = 0; - -INITIALIZE_PASS_BEGIN(AttributorLegacyPass, "attributor", - "Deduce and propagate attributes", false, false) -INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass) -INITIALIZE_PASS_END(AttributorLegacyPass, "attributor", - "Deduce and propagate attributes", false, false) -INITIALIZE_PASS_BEGIN(AttributorCGSCCLegacyPass, "attributor-cgscc", - "Deduce and propagate attributes (CGSCC pass)", false, - false) -INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass) -INITIALIZE_PASS_DEPENDENCY(CallGraphWrapperPass) -INITIALIZE_PASS_END(AttributorCGSCCLegacyPass, "attributor-cgscc", - "Deduce and propagate attributes (CGSCC pass)", false, - false) Index: llvm/lib/Transforms/IPO/IPO.cpp =================================================================== --- llvm/lib/Transforms/IPO/IPO.cpp +++ llvm/lib/Transforms/IPO/IPO.cpp @@ -45,8 +45,6 @@ initializeSingleLoopExtractorPass(Registry); initializeMergeFunctionsLegacyPassPass(Registry); initializePartialInlinerLegacyPassPass(Registry); - initializeAttributorLegacyPassPass(Registry); - initializeAttributorCGSCCLegacyPassPass(Registry); initializePostOrderFunctionAttrsLegacyPassPass(Registry); initializeReversePostOrderFunctionAttrsLegacyPassPass(Registry); initializeIPSCCPLegacyPassPass(Registry); Index: llvm/test/Transforms/Attributor/new_attributes.ll =================================================================== --- llvm/test/Transforms/Attributor/new_attributes.ll +++ llvm/test/Transforms/Attributor/new_attributes.ll @@ -1,8 +1,8 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt < %s -attributor -attributor-annotate-decl-cs -attributor-max-iterations=2 -S | FileCheck %s -; RUN: opt < %s -attributor -attributor-annotate-decl-cs -attributor-max-iterations=3 -S | FileCheck %s -; RUN: opt < %s -attributor -attributor-annotate-decl-cs -attributor-max-iterations=4 -S | FileCheck %s -; RUN: opt < %s -attributor -attributor-annotate-decl-cs -attributor-max-iterations=2147483647 -S | FileCheck %s +; RUN: opt < %s -passes=attributor -attributor-annotate-decl-cs -attributor-max-iterations=2 -S | FileCheck %s +; RUN: opt < %s -passes=attributor -attributor-annotate-decl-cs -attributor-max-iterations=3 -S | FileCheck %s +; RUN: opt < %s -passes=attributor -attributor-annotate-decl-cs -attributor-max-iterations=4 -S | FileCheck %s +; RUN: opt < %s -passes=attributor -attributor-annotate-decl-cs -attributor-max-iterations=2147483647 -S | FileCheck %s ; CHECK-NOT: Function ; CHECK: declare i32 @foo1() Index: llvm/test/Transforms/Attributor/noreturn_async.ll =================================================================== --- llvm/test/Transforms/Attributor/noreturn_async.ll +++ llvm/test/Transforms/Attributor/noreturn_async.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s +; RUN: opt -passes=attributor -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s ; ; This file is the same as noreturn_sync.ll but with a personality which ; indicates that the exception handler *can* catch asynchronous exceptions. As Index: llvm/test/Transforms/Attributor/noreturn_sync.ll =================================================================== --- llvm/test/Transforms/Attributor/noreturn_sync.ll +++ llvm/test/Transforms/Attributor/noreturn_sync.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s +; RUN: opt -passes=attributor -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s ; ; This file is the same as noreturn_async.ll but with a personality which ; indicates that the exception handler *cannot* catch asynchronous exceptions. Index: llvm/test/Transforms/Attributor/value-simplify-pointer-info-struct.ll =================================================================== --- llvm/test/Transforms/Attributor/value-simplify-pointer-info-struct.ll +++ llvm/test/Transforms/Attributor/value-simplify-pointer-info-struct.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=9 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=9 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM ; target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"