Skip to content

Commit 5927c67

Browse files
authored
[AMDGPU][MC] Instructions not to be supported in GFX940 (#109225)
Buffer_store_lds_dword, buffer_wbinvl1, and buffer_wbinvl1_vol are obsolete in GFX940 and should not be supported.
1 parent 127349f commit 5927c67

File tree

6 files changed

+30
-2
lines changed

6 files changed

+30
-2
lines changed

llvm/lib/Target/AMDGPU/AMDGPU.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,6 +1900,10 @@ def isGFX940Plus :
19001900
Predicate<"Subtarget->hasGFX940Insts()">,
19011901
AssemblerPredicate<(all_of FeatureGFX940Insts)>;
19021902

1903+
def isNotGFX940Plus :
1904+
Predicate<"!Subtarget->hasGFX940Insts()">,
1905+
AssemblerPredicate<(all_of (not FeatureGFX940Insts))>;
1906+
19031907
def isGFX8GFX9NotGFX940 :
19041908
Predicate<"!Subtarget->hasGFX940Insts() &&"
19051909
"(Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"

llvm/lib/Target/AMDGPU/BUFInstructions.td

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ let OtherPredicates = [HasGFX10_BEncoding] in {
11321132
>;
11331133
}
11341134

1135-
let SubtargetPredicate = isGFX8GFX9 in {
1135+
let SubtargetPredicate = isGFX8GFX9NotGFX940 in {
11361136
def BUFFER_STORE_LDS_DWORD : MUBUF_Pseudo_Store_Lds <"buffer_store_lds_dword">;
11371137
}
11381138

@@ -1214,7 +1214,7 @@ defm BUFFER_STORE_FORMAT_D16_HI_X : MUBUF_Pseudo_Stores <
12141214

12151215
} // End HasD16LoadStore
12161216

1217-
let SubtargetPredicate = isNotGFX12Plus in
1217+
let SubtargetPredicate = isNotGFX940Plus in
12181218
def BUFFER_WBINVL1 : MUBUF_Invalidate <
12191219
"buffer_wbinvl1", int_amdgcn_buffer_wbinvl1
12201220
>;
@@ -1297,6 +1297,7 @@ let SubtargetPredicate = isGFX7Plus in {
12971297
// Instruction definitions for CI and newer.
12981298
//===----------------------------------------------------------------------===//
12991299

1300+
let SubtargetPredicate = isNotGFX940Plus in
13001301
def BUFFER_WBINVL1_VOL : MUBUF_Invalidate <"buffer_wbinvl1_vol",
13011302
int_amdgcn_buffer_wbinvl1_vol>;
13021303

llvm/test/MC/AMDGPU/gfx10_unsupported.s

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ buffer_store_d16_hi_format_x v1, off, s[12:15], -1 offset:4095
215215
buffer_store_lds_dword s[4:7], -1 offset:4095 lds
216216
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
217217

218+
buffer_wbinvl1
219+
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
220+
218221
buffer_wbinvl1_vol
219222
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
220223

llvm/test/MC/AMDGPU/gfx11_unsupported.s

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ buffer_invl2
3434
buffer_store_lds_dword s[4:7], -1 offset:4095 lds
3535
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
3636

37+
buffer_wbinvl1
38+
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
39+
3740
buffer_wbinvl1_vol
3841
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
3942

llvm/test/MC/AMDGPU/gfx12_unsupported.s

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,15 @@ buffer_gl0_inv
232232
buffer_gl1_inv
233233
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
234234

235+
buffer_store_lds_dword s[4:7], -1 offset:4095 lds
236+
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
237+
235238
buffer_wbinvl1
236239
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
237240

241+
buffer_wbinvl1_vol
242+
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
243+
238244
flat_atomic_csub v1, v[0:1], v2 offset:64 th:TH_ATOMIC_RETURN
239245
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: invalid instruction
240246

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx940 %s 2>&1 | FileCheck --check-prefixes=CHECK --implicit-check-not=error: %s
2+
3+
buffer_store_lds_dword s[4:7], -1 offset:4095 lds
4+
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
5+
6+
buffer_wbinvl1
7+
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
8+
9+
buffer_wbinvl1_vol
10+
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
11+

0 commit comments

Comments
 (0)