-
Notifications
You must be signed in to change notification settings - Fork 14.4k
AMDGPU: Remove export and related instructions from gfx1250 support #145624
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
Merged
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: Changpeng Fang (changpeng) ChangesFull diff: https://github.com/llvm/llvm-project/pull/145624.diff 4 Files Affected:
diff --git a/llvm/lib/Target/AMDGPU/AMDGPU.td b/llvm/lib/Target/AMDGPU/AMDGPU.td
index ed0617048863f..18a253b4d9f48 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPU.td
+++ b/llvm/lib/Target/AMDGPU/AMDGPU.td
@@ -2361,7 +2361,7 @@ def HasFormattedMUBUFInsts : Predicate<"Subtarget->hasFormattedMUBUFInsts()">,
AssemblerPredicate<(all_of (not FeatureGFX1250Insts))>;
def HasExportInsts : Predicate<"Subtarget->hasExportInsts()">,
- AssemblerPredicate<(all_of (not FeatureGFX90AInsts))>;
+ AssemblerPredicate<(all_of (not FeatureGFX90AInsts), (not FeatureGFX1250Insts))>;
def HasVINTERPEncoding : Predicate<"Subtarget->hasVINTERPEncoding()">,
AssemblerPredicate<(all_of FeatureGFX11Insts)>;
diff --git a/llvm/lib/Target/AMDGPU/EXPInstructions.td b/llvm/lib/Target/AMDGPU/EXPInstructions.td
index 5e426b5acd50d..807b69dc85eb7 100644
--- a/llvm/lib/Target/AMDGPU/EXPInstructions.td
+++ b/llvm/lib/Target/AMDGPU/EXPInstructions.td
@@ -119,6 +119,7 @@ multiclass VEXPORT_Real_gfx12 {
def _gfx12 : EXP_Real_Row<ps, SIEncodingFamily.GFX12, "export">,
EXPe_Row {
let AssemblerPredicate = isGFX12Only;
+ let OtherPredicates = [HasExportInsts];
let DecoderNamespace = "GFX12";
let row = ps.row;
let done = ps.done;
diff --git a/llvm/lib/Target/AMDGPU/GCNSubtarget.h b/llvm/lib/Target/AMDGPU/GCNSubtarget.h
index af2c85d961258..927af726a8664 100644
--- a/llvm/lib/Target/AMDGPU/GCNSubtarget.h
+++ b/llvm/lib/Target/AMDGPU/GCNSubtarget.h
@@ -694,7 +694,7 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
bool hasFormattedMUBUFInsts() const { return !hasGFX1250Insts(); }
bool hasExportInsts() const {
- return !hasGFX940Insts();
+ return !hasGFX940Insts() && !hasGFX1250Insts();
}
bool hasVINTERPEncoding() const {
diff --git a/llvm/test/MC/AMDGPU/gfx1250_asm_unsupported.s b/llvm/test/MC/AMDGPU/gfx1250_asm_unsupported.s
index 7e716b99038f5..c2785553030fc 100644
--- a/llvm/test/MC/AMDGPU/gfx1250_asm_unsupported.s
+++ b/llvm/test/MC/AMDGPU/gfx1250_asm_unsupported.s
@@ -1,5 +1,43 @@
; RUN: not llvm-mc -triple=amdgcn -mcpu=gfx1250 -show-encoding %s 2>&1 | FileCheck --check-prefix=GFX1250-ERR --implicit-check-not=error: --strict-whitespace %s
+;; Export, S_WAIT_EXPCNT and S_WAIT_EVENT
+
+export mrt0 off, off, off, off
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+export mrt7 v1, v1, v1, v1
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+export mrtz v4, v3, v2, v1
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+export pos0 v4, v3, v2, v1
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+export pos3 v4, v3, v2, v1
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+exp mrt0 off, off, off, off
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+exp mrt7 v1, v1, v1, v1
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+exp mrtz v4, v3, v2, v1
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+exp pos0 v4, v3, v2, v1
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+exp pos3 v4, v3, v2, v1
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+s_wait_event 0x3141
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+s_wait_expcnt 0x1234
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
;; Ray Tracing: DS_BVH_STACK ops
ds_bvh_stack_rtn_b32 v255, v254, v253, v[249:252]
|
@llvm/pr-subscribers-mc Author: Changpeng Fang (changpeng) ChangesFull diff: https://github.com/llvm/llvm-project/pull/145624.diff 4 Files Affected:
diff --git a/llvm/lib/Target/AMDGPU/AMDGPU.td b/llvm/lib/Target/AMDGPU/AMDGPU.td
index ed0617048863f..18a253b4d9f48 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPU.td
+++ b/llvm/lib/Target/AMDGPU/AMDGPU.td
@@ -2361,7 +2361,7 @@ def HasFormattedMUBUFInsts : Predicate<"Subtarget->hasFormattedMUBUFInsts()">,
AssemblerPredicate<(all_of (not FeatureGFX1250Insts))>;
def HasExportInsts : Predicate<"Subtarget->hasExportInsts()">,
- AssemblerPredicate<(all_of (not FeatureGFX90AInsts))>;
+ AssemblerPredicate<(all_of (not FeatureGFX90AInsts), (not FeatureGFX1250Insts))>;
def HasVINTERPEncoding : Predicate<"Subtarget->hasVINTERPEncoding()">,
AssemblerPredicate<(all_of FeatureGFX11Insts)>;
diff --git a/llvm/lib/Target/AMDGPU/EXPInstructions.td b/llvm/lib/Target/AMDGPU/EXPInstructions.td
index 5e426b5acd50d..807b69dc85eb7 100644
--- a/llvm/lib/Target/AMDGPU/EXPInstructions.td
+++ b/llvm/lib/Target/AMDGPU/EXPInstructions.td
@@ -119,6 +119,7 @@ multiclass VEXPORT_Real_gfx12 {
def _gfx12 : EXP_Real_Row<ps, SIEncodingFamily.GFX12, "export">,
EXPe_Row {
let AssemblerPredicate = isGFX12Only;
+ let OtherPredicates = [HasExportInsts];
let DecoderNamespace = "GFX12";
let row = ps.row;
let done = ps.done;
diff --git a/llvm/lib/Target/AMDGPU/GCNSubtarget.h b/llvm/lib/Target/AMDGPU/GCNSubtarget.h
index af2c85d961258..927af726a8664 100644
--- a/llvm/lib/Target/AMDGPU/GCNSubtarget.h
+++ b/llvm/lib/Target/AMDGPU/GCNSubtarget.h
@@ -694,7 +694,7 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
bool hasFormattedMUBUFInsts() const { return !hasGFX1250Insts(); }
bool hasExportInsts() const {
- return !hasGFX940Insts();
+ return !hasGFX940Insts() && !hasGFX1250Insts();
}
bool hasVINTERPEncoding() const {
diff --git a/llvm/test/MC/AMDGPU/gfx1250_asm_unsupported.s b/llvm/test/MC/AMDGPU/gfx1250_asm_unsupported.s
index 7e716b99038f5..c2785553030fc 100644
--- a/llvm/test/MC/AMDGPU/gfx1250_asm_unsupported.s
+++ b/llvm/test/MC/AMDGPU/gfx1250_asm_unsupported.s
@@ -1,5 +1,43 @@
; RUN: not llvm-mc -triple=amdgcn -mcpu=gfx1250 -show-encoding %s 2>&1 | FileCheck --check-prefix=GFX1250-ERR --implicit-check-not=error: --strict-whitespace %s
+;; Export, S_WAIT_EXPCNT and S_WAIT_EVENT
+
+export mrt0 off, off, off, off
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+export mrt7 v1, v1, v1, v1
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+export mrtz v4, v3, v2, v1
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+export pos0 v4, v3, v2, v1
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+export pos3 v4, v3, v2, v1
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+exp mrt0 off, off, off, off
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+exp mrt7 v1, v1, v1, v1
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+exp mrtz v4, v3, v2, v1
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+exp pos0 v4, v3, v2, v1
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+exp pos3 v4, v3, v2, v1
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+s_wait_event 0x3141
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+s_wait_expcnt 0x1234
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
;; Ray Tracing: DS_BVH_STACK ops
ds_bvh_stack_rtn_b32 v255, v254, v253, v[249:252]
|
shiltian
approved these changes
Jun 25, 2025
anthonyhatran
pushed a commit
to anthonyhatran/llvm-project
that referenced
this pull request
Jun 26, 2025
rlavaee
pushed a commit
to rlavaee/llvm-project
that referenced
this pull request
Jul 1, 2025
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.
No description provided.