aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
diff options
context:
space:
mode:
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2022-11-10 20:11:06 +0100
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2022-11-28 10:24:16 +0100
commit99c47d9e3113a917ea2f84f27e57f2ea3da4fc8c (patch)
tree2b4b4841027ffff40912985c6e2c9afca2aefdd8 /llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
parent962343a979d51cea9363167e9121c446abbdfdbc (diff)
downloadllvm-99c47d9e3113a917ea2f84f27e57f2ea3da4fc8c.zip
llvm-99c47d9e3113a917ea2f84f27e57f2ea3da4fc8c.tar.gz
llvm-99c47d9e3113a917ea2f84f27e57f2ea3da4fc8c.tar.bz2
Remove TargetMachine::adjustPassManager
Since opt no longer supports to run default (O0/O1/O2/O3/Os/Oz) pipelines using the legacy PM, there are no in-tree uses of TargetMachine::adjustPassManager remaining. This patch removes the no longer used adjustPassManager functions. Reviewed By: aeubanks Differential Revision: https://reviews.llvm.org/D137796
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp75
1 files changed, 0 insertions, 75 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
index df43fb0..2199630 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
@@ -51,7 +51,6 @@
#include "llvm/Transforms/IPO/AlwaysInliner.h"
#include "llvm/Transforms/IPO/GlobalDCE.h"
#include "llvm/Transforms/IPO/Internalize.h"
-#include "llvm/Transforms/IPO/PassManagerBuilder.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Scalar/GVN.h"
#include "llvm/Transforms/Scalar/InferAddressSpaces.h"
@@ -576,80 +575,6 @@ static bool mustPreserveGV(const GlobalValue &GV) {
return !GV.use_empty();
}
-void AMDGPUTargetMachine::adjustPassManager(PassManagerBuilder &Builder) {
- Builder.DivergentTarget = true;
-
- bool EnableOpt = getOptLevel() > CodeGenOpt::None;
- bool Internalize = InternalizeSymbols;
- bool EarlyInline = EarlyInlineAll && EnableOpt && !EnableFunctionCalls;
- bool AMDGPUAA = EnableAMDGPUAliasAnalysis && EnableOpt;
- bool LibCallSimplify = EnableLibCallSimplify && EnableOpt;
- bool PromoteKernelArguments =
- EnablePromoteKernelArguments && getOptLevel() > CodeGenOpt::Less;
-
- if (EnableFunctionCalls) {
- delete Builder.Inliner;
- Builder.Inliner = createFunctionInliningPass();
- }
-
- Builder.addExtension(
- PassManagerBuilder::EP_ModuleOptimizerEarly,
- [Internalize, EarlyInline, AMDGPUAA, this](const PassManagerBuilder &,
- legacy::PassManagerBase &PM) {
- if (AMDGPUAA) {
- PM.add(createAMDGPUAAWrapperPass());
- PM.add(createAMDGPUExternalAAWrapperPass());
- }
- PM.add(createAMDGPUUnifyMetadataPass());
- PM.add(createAMDGPUPrintfRuntimeBinding());
- if (Internalize)
- PM.add(createInternalizePass(mustPreserveGV));
- PM.add(createAMDGPUPropagateAttributesLatePass(this));
- if (Internalize)
- PM.add(createGlobalDCEPass());
- if (EarlyInline)
- PM.add(createAMDGPUAlwaysInlinePass(false));
- });
-
- Builder.addExtension(
- PassManagerBuilder::EP_EarlyAsPossible,
- [AMDGPUAA, LibCallSimplify, this](const PassManagerBuilder &,
- legacy::PassManagerBase &PM) {
- if (AMDGPUAA) {
- PM.add(createAMDGPUAAWrapperPass());
- PM.add(createAMDGPUExternalAAWrapperPass());
- }
- PM.add(llvm::createAMDGPUPropagateAttributesEarlyPass(this));
- PM.add(llvm::createAMDGPUUseNativeCallsPass());
- if (LibCallSimplify)
- PM.add(llvm::createAMDGPUSimplifyLibCallsPass(this));
- });
-
- Builder.addExtension(
- PassManagerBuilder::EP_CGSCCOptimizerLate,
- [EnableOpt, PromoteKernelArguments](const PassManagerBuilder &,
- legacy::PassManagerBase &PM) {
- // Add promote kernel arguments pass to the opt pipeline right before
- // infer address spaces which is needed to do actual address space
- // rewriting.
- if (PromoteKernelArguments)
- PM.add(createAMDGPUPromoteKernelArgumentsPass());
-
- // Add infer address spaces pass to the opt pipeline after inlining
- // but before SROA to increase SROA opportunities.
- PM.add(createInferAddressSpacesPass());
-
- // This should run after inlining to have any chance of doing anything,
- // and before other cleanup optimizations.
- PM.add(createAMDGPULowerKernelAttributesPass());
-
- // Promote alloca to vector before SROA and loop unroll. If we manage
- // to eliminate allocas before unroll we may choose to unroll less.
- if (EnableOpt)
- PM.add(createAMDGPUPromoteAllocaToVector());
- });
-}
-
void AMDGPUTargetMachine::registerDefaultAliasAnalyses(AAManager &AAM) {
AAM.registerFunctionAnalysis<AMDGPUAA>();
}