Skip to content

Commit 3de2af3

Browse files
authored
AMDGPU: Remove export and related instructions from gfx1250 support (#145624)
1 parent 30922f7 commit 3de2af3

File tree

4 files changed

+41
-2
lines changed

4 files changed

+41
-2
lines changed

llvm/lib/Target/AMDGPU/AMDGPU.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2361,7 +2361,7 @@ def HasFormattedMUBUFInsts : Predicate<"Subtarget->hasFormattedMUBUFInsts()">,
23612361
AssemblerPredicate<(all_of (not FeatureGFX1250Insts))>;
23622362

23632363
def HasExportInsts : Predicate<"Subtarget->hasExportInsts()">,
2364-
AssemblerPredicate<(all_of (not FeatureGFX90AInsts))>;
2364+
AssemblerPredicate<(all_of (not FeatureGFX90AInsts), (not FeatureGFX1250Insts))>;
23652365

23662366
def HasVINTERPEncoding : Predicate<"Subtarget->hasVINTERPEncoding()">,
23672367
AssemblerPredicate<(all_of FeatureGFX11Insts)>;

llvm/lib/Target/AMDGPU/EXPInstructions.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ multiclass VEXPORT_Real_gfx12 {
119119
def _gfx12 : EXP_Real_Row<ps, SIEncodingFamily.GFX12, "export">,
120120
EXPe_Row {
121121
let AssemblerPredicate = isGFX12Only;
122+
let OtherPredicates = [HasExportInsts];
122123
let DecoderNamespace = "GFX12";
123124
let row = ps.row;
124125
let done = ps.done;

llvm/lib/Target/AMDGPU/GCNSubtarget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
694694
bool hasFormattedMUBUFInsts() const { return !hasGFX1250Insts(); }
695695

696696
bool hasExportInsts() const {
697-
return !hasGFX940Insts();
697+
return !hasGFX940Insts() && !hasGFX1250Insts();
698698
}
699699

700700
bool hasVINTERPEncoding() const {

llvm/test/MC/AMDGPU/gfx1250_asm_unsupported.s

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,43 @@
11
; 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
22

3+
;; Export, S_WAIT_EXPCNT and S_WAIT_EVENT
4+
5+
export mrt0 off, off, off, off
6+
// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
7+
8+
export mrt7 v1, v1, v1, v1
9+
// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
10+
11+
export mrtz v4, v3, v2, v1
12+
// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
13+
14+
export pos0 v4, v3, v2, v1
15+
// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
16+
17+
export pos3 v4, v3, v2, v1
18+
// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
19+
20+
exp mrt0 off, off, off, off
21+
// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
22+
23+
exp mrt7 v1, v1, v1, v1
24+
// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
25+
26+
exp mrtz v4, v3, v2, v1
27+
// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
28+
29+
exp pos0 v4, v3, v2, v1
30+
// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
31+
32+
exp pos3 v4, v3, v2, v1
33+
// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
34+
35+
s_wait_event 0x3141
36+
// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
37+
38+
s_wait_expcnt 0x1234
39+
// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
40+
341
;; Ray Tracing: DS_BVH_STACK ops
442

543
ds_bvh_stack_rtn_b32 v255, v254, v253, v[249:252]

0 commit comments

Comments
 (0)