-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
AMDGPU: Use GCNTargetMachine in AMDGPUCodeGenPassBuilder #102805
Merged
arsenm
merged 1 commit into
main
from
users/arsenm/newpm/use-gcntargetmachine-amdgpucodegenpassbuilder
Aug 12, 2024
Merged
AMDGPU: Use GCNTargetMachine in AMDGPUCodeGenPassBuilder #102805
arsenm
merged 1 commit into
main
from
users/arsenm/newpm/use-gcntargetmachine-amdgpucodegenpassbuilder
Aug 12, 2024
Conversation
This file contains 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) ChangesR600 has a separate CodeGenPassBuilder anyway. Full diff: https://github.com/llvm/llvm-project/pull/102805.diff 4 Files Affected:
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPassBuilder.cpp b/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPassBuilder.cpp
index cc4285f130fc8..0d829b6aeafe8 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPassBuilder.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPassBuilder.cpp
@@ -15,7 +15,7 @@
using namespace llvm;
AMDGPUCodeGenPassBuilder::AMDGPUCodeGenPassBuilder(
- AMDGPUTargetMachine &TM, const CGPassBuilderOption &Opts,
+ GCNTargetMachine &TM, const CGPassBuilderOption &Opts,
PassInstrumentationCallbacks *PIC)
: CodeGenPassBuilder(TM, Opts, PIC) {
Opt.RequiresCodeGenSCCOrder = true;
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPassBuilder.h b/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPassBuilder.h
index 5f79e309703a3..e656e166b3eb2 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPassBuilder.h
+++ b/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPassBuilder.h
@@ -14,12 +14,12 @@
namespace llvm {
-class AMDGPUTargetMachine;
+class GCNTargetMachine;
class AMDGPUCodeGenPassBuilder
- : public CodeGenPassBuilder<AMDGPUCodeGenPassBuilder, AMDGPUTargetMachine> {
+ : public CodeGenPassBuilder<AMDGPUCodeGenPassBuilder, GCNTargetMachine> {
public:
- AMDGPUCodeGenPassBuilder(AMDGPUTargetMachine &TM,
+ AMDGPUCodeGenPassBuilder(GCNTargetMachine &TM,
const CGPassBuilderOption &Opts,
PassInstrumentationCallbacks *PIC);
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
index 202466f18d1bd..62cf9c6cd6114 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
@@ -660,14 +660,6 @@ parseAMDGPUAtomicOptimizerStrategy(StringRef Params) {
return make_error<StringError>("invalid parameter", inconvertibleErrorCode());
}
-Error AMDGPUTargetMachine::buildCodeGenPipeline(
- ModulePassManager &MPM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut,
- CodeGenFileType FileType, const CGPassBuilderOption &Opts,
- PassInstrumentationCallbacks *PIC) {
- AMDGPUCodeGenPassBuilder CGPB(*this, Opts, PIC);
- return CGPB.buildPipeline(MPM, Out, DwoOut, FileType);
-}
-
void AMDGPUTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
#define GET_PASS_REGISTRY "AMDGPUPassRegistry.def"
@@ -900,6 +892,14 @@ GCNTargetMachine::getTargetTransformInfo(const Function &F) const {
return TargetTransformInfo(GCNTTIImpl(this, F));
}
+Error GCNTargetMachine::buildCodeGenPipeline(
+ ModulePassManager &MPM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut,
+ CodeGenFileType FileType, const CGPassBuilderOption &Opts,
+ PassInstrumentationCallbacks *PIC) {
+ AMDGPUCodeGenPassBuilder CGPB(*this, Opts, PIC);
+ return CGPB.buildPipeline(MPM, Out, DwoOut, FileType);
+}
+
//===----------------------------------------------------------------------===//
// AMDGPU Pass Setup
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h
index 0f74fbc22fa84..6bb8788cc73b0 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h
@@ -52,12 +52,6 @@ class AMDGPUTargetMachine : public LLVMTargetMachine {
return TLOF.get();
}
- Error buildCodeGenPipeline(ModulePassManager &MPM, raw_pwrite_stream &Out,
- raw_pwrite_stream *DwoOut,
- CodeGenFileType FileType,
- const CGPassBuilderOption &Opts,
- PassInstrumentationCallbacks *PIC) override;
-
void registerPassBuilderCallbacks(PassBuilder &PB) override;
void registerDefaultAliasAnalyses(AAManager &) override;
@@ -103,6 +97,12 @@ class GCNTargetMachine final : public AMDGPUTargetMachine {
return true;
}
+ Error buildCodeGenPipeline(ModulePassManager &MPM, raw_pwrite_stream &Out,
+ raw_pwrite_stream *DwoOut,
+ CodeGenFileType FileType,
+ const CGPassBuilderOption &Opts,
+ PassInstrumentationCallbacks *PIC) override;
+
void registerMachineRegisterInfoCallback(MachineFunction &MF) const override;
MachineFunctionInfo *
|
arsenm
requested review from
aeubanks,
jayfoad,
jdoerfert,
paperchalice,
Pierre-vh and
rampitec
August 11, 2024 08:34
paperchalice
approved these changes
Aug 11, 2024
Merge activity
|
arsenm
force-pushed
the
users/arsenm/newpm/port-amdgpu-perf-hint-analysis
branch
from
August 11, 2024 11:07
0fa3fea
to
25f1d7e
Compare
Base automatically changed from
users/arsenm/newpm/port-amdgpu-perf-hint-analysis
to
main
August 11, 2024 11:11
arsenm
force-pushed
the
users/arsenm/newpm/use-gcntargetmachine-amdgpucodegenpassbuilder
branch
from
August 11, 2024 12:33
0a6b6ee
to
bb28b4e
Compare
arsenm
force-pushed
the
users/arsenm/newpm/use-gcntargetmachine-amdgpucodegenpassbuilder
branch
from
August 11, 2024 14:31
bb28b4e
to
27fade6
Compare
This was referenced Aug 11, 2024
Pierre-vh
approved these changes
Aug 12, 2024
Add [NFC] tag? |
R600 has a separate CodeGenPassBuilder anyway.
arsenm
force-pushed
the
users/arsenm/newpm/use-gcntargetmachine-amdgpucodegenpassbuilder
branch
from
August 12, 2024 11:00
27fade6
to
f6ade48
Compare
arsenm
deleted the
users/arsenm/newpm/use-gcntargetmachine-amdgpucodegenpassbuilder
branch
August 12, 2024 11:02
bwendling
pushed a commit
to bwendling/llvm-project
that referenced
this pull request
Aug 15, 2024
R600 has a separate CodeGenPassBuilder anyway.
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.
R600 has a separate CodeGenPassBuilder anyway.