-
Notifications
You must be signed in to change notification settings - Fork 14.3k
AMDGPU: Really delete AMDGPUAnnotateKernelFeatures #145136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
arsenm
wants to merge
1
commit into
main
Choose a base branch
from
users/arsenm/amdgpu/really-delete-AMDGPUAnnotateKernelFeatures
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
AMDGPU: Really delete AMDGPUAnnotateKernelFeatures #145136
arsenm
wants to merge
1
commit into
main
from
users/arsenm/amdgpu/really-delete-AMDGPUAnnotateKernelFeatures
+0
−133
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@llvm/pr-subscribers-backend-amdgpu Author: Matt Arsenault (arsenm) Changes31f39c8 claimed to have removed it, Full diff: https://github.com/llvm/llvm-project/pull/145136.diff 1 Files Affected:
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAnnotateKernelFeatures.cpp b/llvm/lib/Target/AMDGPU/AMDGPUAnnotateKernelFeatures.cpp
deleted file mode 100644
index 9c9fa5c6e2f0f..0000000000000
--- a/llvm/lib/Target/AMDGPU/AMDGPUAnnotateKernelFeatures.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-//===- AMDGPUAnnotateKernelFeaturesPass.cpp -------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-/// \file This pass propagates the uniform-work-group-size attribute from
-/// kernels to leaf functions when possible. It also adds additional attributes
-/// to hint ABI lowering optimizations later.
-//
-//===----------------------------------------------------------------------===//
-
-#include "AMDGPU.h"
-#include "GCNSubtarget.h"
-#include "llvm/Analysis/CallGraph.h"
-#include "llvm/Analysis/CallGraphSCCPass.h"
-#include "llvm/CodeGen/TargetPassConfig.h"
-#include "llvm/Target/TargetMachine.h"
-
-#define DEBUG_TYPE "amdgpu-annotate-kernel-features"
-
-using namespace llvm;
-
-namespace {
-class AMDGPUAnnotateKernelFeatures : public CallGraphSCCPass {
-private:
- const TargetMachine *TM = nullptr;
-
- bool addFeatureAttributes(Function &F);
-
-public:
- static char ID;
-
- AMDGPUAnnotateKernelFeatures() : CallGraphSCCPass(ID) {}
-
- bool doInitialization(CallGraph &CG) override;
- bool runOnSCC(CallGraphSCC &SCC) override;
-
- StringRef getPassName() const override {
- return "AMDGPU Annotate Kernel Features";
- }
-
- void getAnalysisUsage(AnalysisUsage &AU) const override {
- AU.setPreservesAll();
- CallGraphSCCPass::getAnalysisUsage(AU);
- }
-};
-
-} // end anonymous namespace
-
-char AMDGPUAnnotateKernelFeatures::ID = 0;
-
-bool AMDGPUAnnotateKernelFeatures::addFeatureAttributes(Function &F) {
- bool HaveStackObjects = false;
- bool Changed = false;
- bool HaveCall = false;
- bool IsFunc = !AMDGPU::isEntryFunctionCC(F.getCallingConv());
-
- for (BasicBlock &BB : F) {
- for (Instruction &I : BB) {
- if (isa<AllocaInst>(I)) {
- HaveStackObjects = true;
- continue;
- }
-
- if (auto *CB = dyn_cast<CallBase>(&I)) {
- const Function *Callee =
- dyn_cast<Function>(CB->getCalledOperand()->stripPointerCasts());
-
- // Note the occurrence of indirect call.
- if (!Callee) {
- if (!CB->isInlineAsm())
- HaveCall = true;
-
- continue;
- }
-
- Intrinsic::ID IID = Callee->getIntrinsicID();
- if (IID == Intrinsic::not_intrinsic) {
- HaveCall = true;
- Changed = true;
- }
- }
- }
- }
-
- // TODO: We could refine this to captured pointers that could possibly be
- // accessed by flat instructions. For now this is mostly a poor way of
- // estimating whether there are calls before argument lowering.
- if (!IsFunc && HaveCall) {
- F.addFnAttr("amdgpu-calls");
- Changed = true;
- }
-
- if (HaveStackObjects) {
- F.addFnAttr("amdgpu-stack-objects");
- Changed = true;
- }
-
- return Changed;
-}
-
-bool AMDGPUAnnotateKernelFeatures::runOnSCC(CallGraphSCC &SCC) {
- bool Changed = false;
-
- for (CallGraphNode *I : SCC) {
- Function *F = I->getFunction();
- // Ignore functions with graphics calling conventions, these are currently
- // not allowed to have kernel arguments.
- if (!F || F->isDeclaration() || AMDGPU::isGraphics(F->getCallingConv()))
- continue;
- // Add feature attributes
- Changed |= addFeatureAttributes(*F);
- }
-
- return Changed;
-}
-
-bool AMDGPUAnnotateKernelFeatures::doInitialization(CallGraph &CG) {
- auto *TPC = getAnalysisIfAvailable<TargetPassConfig>();
- if (!TPC)
- report_fatal_error("TargetMachine is required");
-
- TM = &TPC->getTM<TargetMachine>();
- return false;
-}
|
31f39c8 claimed to have removed it, but it's still here so really remove it.
5cbe0d6
to
2e9b85b
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
31f39c8 claimed to have removed it,
but it's still here so really remove it.