[llvm] 9a80655 - AMDGPU: Delete old PM support for libcall passes
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 1 15:28:10 PDT 2023
Author: Matt Arsenault
Date: 2023-08-01T18:22:02-04:00
New Revision: 9a806551a002d4125b0419955c1b9c47627f5798
URL: https://github.com/llvm/llvm-project/commit/9a806551a002d4125b0419955c1b9c47627f5798
DIFF: https://github.com/llvm/llvm-project/commit/9a806551a002d4125b0419955c1b9c47627f5798.diff
LOG: AMDGPU: Delete old PM support for libcall passes
This has no reason to run in the codegen pipeline.
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPU.h
llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPU.h b/llvm/lib/Target/AMDGPU/AMDGPU.h
index 86778ed301858f..f95d96120d957d 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPU.h
+++ b/llvm/lib/Target/AMDGPU/AMDGPU.h
@@ -48,8 +48,6 @@ FunctionPass *createSIPreAllocateWWMRegsPass();
FunctionPass *createSIFormMemoryClausesPass();
FunctionPass *createSIPostRABundlerPass();
-FunctionPass *createAMDGPUSimplifyLibCallsPass();
-FunctionPass *createAMDGPUUseNativeCallsPass();
ModulePass *createAMDGPURemoveIncompatibleFunctionsPass(const TargetMachine *);
FunctionPass *createAMDGPUCodeGenPreparePass();
FunctionPass *createAMDGPULateCodeGenPreparePass();
@@ -172,12 +170,6 @@ extern char &SIOptimizeExecMaskingID;
void initializeSIPreAllocateWWMRegsPass(PassRegistry &);
extern char &SIPreAllocateWWMRegsID;
-void initializeAMDGPUSimplifyLibCallsPass(PassRegistry &);
-extern char &AMDGPUSimplifyLibCallsID;
-
-void initializeAMDGPUUseNativeCallsPass(PassRegistry &);
-extern char &AMDGPUUseNativeCallsID;
-
void initializeAMDGPUPerfHintAnalysisPass(PassRegistry &);
extern char &AMDGPUPerfHintAnalysisID;
diff --git a/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp b/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
index cf08f072a01565..b65b09fd207094 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
@@ -134,55 +134,6 @@ class AMDGPULibCalls {
} // end llvm namespace
-namespace {
-
- class AMDGPUSimplifyLibCalls : public FunctionPass {
-
- AMDGPULibCalls Simplifier;
-
- public:
- static char ID; // Pass identification
-
- AMDGPUSimplifyLibCalls() : FunctionPass(ID) {
- initializeAMDGPUSimplifyLibCallsPass(*PassRegistry::getPassRegistry());
- }
-
- bool runOnFunction(Function &M) override;
- };
-
- class AMDGPUUseNativeCalls : public FunctionPass {
-
- AMDGPULibCalls Simplifier;
-
- public:
- static char ID; // Pass identification
-
- AMDGPUUseNativeCalls() : FunctionPass(ID) {
- initializeAMDGPUUseNativeCallsPass(*PassRegistry::getPassRegistry());
- Simplifier.initNativeFuncs();
- }
-
- void getAnalysisUsage(AnalysisUsage &AU) const override {
- // TODO: Preserves most
- }
-
- bool runOnFunction(Function &F) override;
- };
-
-} // end anonymous namespace.
-
-char AMDGPUSimplifyLibCalls::ID = 0;
-char AMDGPUUseNativeCalls::ID = 0;
-
-INITIALIZE_PASS_BEGIN(AMDGPUSimplifyLibCalls, "amdgpu-simplifylib",
- "Simplify well-known AMD library calls", false, false)
-INITIALIZE_PASS_END(AMDGPUSimplifyLibCalls, "amdgpu-simplifylib",
- "Simplify well-known AMD library calls", false, false)
-
-INITIALIZE_PASS(AMDGPUUseNativeCalls, "amdgpu-usenative",
- "Replace builtin math calls with that native versions.",
- false, false)
-
template <typename IRB>
static CallInst *CreateCallEx(IRB &B, FunctionCallee Callee, Value *Arg,
const Twine &Name = "") {
@@ -1605,40 +1556,6 @@ bool AMDGPULibCalls::evaluateCall(CallInst *aCI, const FuncInfo &FInfo) {
return true;
}
-// Public interface to the Simplify LibCalls pass.
-FunctionPass *llvm::createAMDGPUSimplifyLibCallsPass() {
- return new AMDGPUSimplifyLibCalls();
-}
-
-FunctionPass *llvm::createAMDGPUUseNativeCallsPass() {
- return new AMDGPUUseNativeCalls();
-}
-
-bool AMDGPUSimplifyLibCalls::runOnFunction(Function &F) {
- if (skipFunction(F))
- return false;
-
- Simplifier.initFunction(F);
-
- bool Changed = false;
-
- LLVM_DEBUG(dbgs() << "AMDIC: process function ";
- F.printAsOperand(dbgs(), false, F.getParent()); dbgs() << '\n';);
-
- for (auto &BB : F) {
- for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ) {
- // Ignore non-calls.
- CallInst *CI = dyn_cast<CallInst>(I);
- ++I;
- if (CI) {
- if (Simplifier.fold(CI))
- Changed = true;
- }
- }
- }
- return Changed;
-}
-
PreservedAnalyses AMDGPUSimplifyLibCallsPass::run(Function &F,
FunctionAnalysisManager &AM) {
AMDGPULibCalls Simplifier;
@@ -1665,25 +1582,6 @@ PreservedAnalyses AMDGPUSimplifyLibCallsPass::run(Function &F,
return Changed ? PreservedAnalyses::none() : PreservedAnalyses::all();
}
-bool AMDGPUUseNativeCalls::runOnFunction(Function &F) {
- if (skipFunction(F) || UseNative.empty())
- return false;
-
- Simplifier.initFunction(F);
-
- bool Changed = false;
- for (auto &BB : F) {
- for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ) {
- // Ignore non-calls.
- CallInst *CI = dyn_cast<CallInst>(I);
- ++I;
- if (CI && Simplifier.useNative(CI))
- Changed = true;
- }
- }
- return Changed;
-}
-
PreservedAnalyses AMDGPUUseNativeCallsPass::run(Function &F,
FunctionAnalysisManager &AM) {
if (UseNative.empty())
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
index 2be85724a10109..46906f5b8c3f9e 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
@@ -416,8 +416,6 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUTarget() {
initializeAMDGPUUnifyDivergentExitNodesPass(*PR);
initializeAMDGPUAAWrapperPassPass(*PR);
initializeAMDGPUExternalAAWrapperPass(*PR);
- initializeAMDGPUUseNativeCallsPass(*PR);
- initializeAMDGPUSimplifyLibCallsPass(*PR);
initializeAMDGPUPrintfRuntimeBindingPass(*PR);
initializeAMDGPUResourceUsageAnalysisPass(*PR);
initializeGCNNSAReassignPass(*PR);
More information about the llvm-commits
mailing list