-
Notifications
You must be signed in to change notification settings - Fork 15.5k
[AMDGPU] Emit amdgpu.max_num_named_barrier resource symbol #169851
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] Emit amdgpu.max_num_named_barrier resource symbol #169851
Conversation
|
@llvm/pr-subscribers-backend-amdgpu Author: None (PMylon) ChangesEmit Full diff: https://github.com/llvm/llvm-project/pull/169851.diff 3 Files Affected:
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp b/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
index 33cef795b111d..270154452f6df 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
@@ -536,7 +536,8 @@ bool AMDGPUAsmPrinter::doFinalization(Module &M) {
OutStreamer->switchSection(MaxGPRSection);
getTargetStreamer()->EmitMCResourceMaximums(RI.getMaxVGPRSymbol(OutContext),
RI.getMaxAGPRSymbol(OutContext),
- RI.getMaxSGPRSymbol(OutContext));
+ RI.getMaxSGPRSymbol(OutContext),
+ RI.getMaxNamedBarrierSymbol(OutContext));
OutStreamer->popSection();
for (Function &F : M.functions())
diff --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
index 5a0857322a39b..b12b6ed441659 100644
--- a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
+++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
@@ -304,7 +304,8 @@ void AMDGPUTargetAsmStreamer::EmitMCResourceInfo(
void AMDGPUTargetAsmStreamer::EmitMCResourceMaximums(const MCSymbol *MaxVGPR,
const MCSymbol *MaxAGPR,
- const MCSymbol *MaxSGPR) {
+ const MCSymbol *MaxSGPR,
+ const MCSymbol *MaxNamedBarrier) {
#define PRINT_RES_INFO(ARG) \
OS << "\t.set "; \
ARG->print(OS, getContext().getAsmInfo()); \
@@ -315,6 +316,7 @@ void AMDGPUTargetAsmStreamer::EmitMCResourceMaximums(const MCSymbol *MaxVGPR,
PRINT_RES_INFO(MaxVGPR);
PRINT_RES_INFO(MaxAGPR);
PRINT_RES_INFO(MaxSGPR);
+ PRINT_RES_INFO(MaxNamedBarrier);
#undef PRINT_RES_INFO
}
diff --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.h b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.h
index 22afcdebcdf09..3a0d8dcd2d27c 100644
--- a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.h
+++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.h
@@ -69,7 +69,8 @@ class AMDGPUTargetStreamer : public MCTargetStreamer {
virtual void EmitMCResourceMaximums(const MCSymbol *MaxVGPR,
const MCSymbol *MaxAGPR,
- const MCSymbol *MaxSGPR) {};
+ const MCSymbol *MaxSGPR,
+ const MCSymbol *MaxNamedBarrier) {};
/// \returns True on success, false on failure.
virtual bool EmitISAVersion() { return true; }
@@ -149,7 +150,8 @@ class AMDGPUTargetAsmStreamer final : public AMDGPUTargetStreamer {
const MCSymbol *HasRecursion, const MCSymbol *HasIndirectCall) override;
void EmitMCResourceMaximums(const MCSymbol *MaxVGPR, const MCSymbol *MaxAGPR,
- const MCSymbol *MaxSGPR) override;
+ const MCSymbol *MaxSGPR,
+ const MCSymbol *MaxNamedBarrier) override;
/// \returns True on success, false on failure.
bool EmitISAVersion() override;
|
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
arsenm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing tests
nhaehnle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/129/builds/34393 Here is the relevant piece of the build log for the reference |
This pulls in the following fixes: * llvm/llvm-project#168801 * llvm/llvm-project#168805 * llvm/llvm-project#169851 Along the way, we need to adjust `TMEMLoadOpPattern` and `RelayoutTritonGPU` due to * llvm/llvm-project#169606
This pulls in the following fixes: * llvm/llvm-project#168801 * llvm/llvm-project#168805 * llvm/llvm-project#169851 Along the way, we need to adjust `TMEMLoadOpPattern` and `RelayoutTritonGPU` due to * llvm/llvm-project#169606
This pulls in the following fixes: * llvm/llvm-project#168801 * llvm/llvm-project#168805 * llvm/llvm-project#169851 Along the way, we need to adjust `TMEMLoadOpPattern` and `RelayoutTritonGPU` due to * llvm/llvm-project#169606
Emit
amdgpu.max_num_named_barrierresource symbol which is referenced byamdgcn.device.init.num_named_barrier, max(0, amdgpu.max_num_named_barrier). FixesLLVM ERROR: cannot evaluate equated symbol 'amdgcn.device.init.num_named_barrier'when using ASan.