Skip to content

Commit 83db07b

Browse files
committed
Avoid adding multiple addressablelocalmemorysizes to gfx950
Also expand the limit testing.
1 parent c5cdc98 commit 83db07b

File tree

3 files changed

+43
-18
lines changed

3 files changed

+43
-18
lines changed

llvm/lib/Target/AMDGPU/AMDGPU.td

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ def FeatureVolcanicIslands : GCNSubtargetFeatureGeneration<"VOLCANIC_ISLANDS",
11921192

11931193
def FeatureGFX9 : GCNSubtargetFeatureGeneration<"GFX9",
11941194
"gfx9",
1195-
[FeatureFP64, FeatureAddressableLocalMemorySize65536,
1195+
[FeatureFP64,
11961196
FeatureWavefrontSize64, FeatureFlatAddressSpace,
11971197
FeatureGCN3Encoding, FeatureCIInsts, Feature16BitInsts,
11981198
FeatureSMemRealTime, FeatureScalarStores, FeatureInv2PiInlineImm,
@@ -1358,6 +1358,7 @@ def FeatureISAVersion8_1_0 : FeatureSet<
13581358

13591359
def FeatureISAVersion9_0_Common : FeatureSet<
13601360
[FeatureGFX9,
1361+
FeatureAddressableLocalMemorySize65536,
13611362
FeatureLDSBankCount32,
13621363
FeatureImageInsts,
13631364
FeatureMadMacF32Insts]>;
@@ -1375,7 +1376,8 @@ def FeatureISAVersion9_Generic : FeatureSet<
13751376

13761377
def FeatureISAVersion9_0_MI_Common : FeatureSet<
13771378
!listconcat(FeatureISAVersion9_0_Common.Features,
1378-
[FeatureFmaMixInsts,
1379+
[FeatureAddressableLocalMemorySize65536,
1380+
FeatureFmaMixInsts,
13791381
FeatureDLInsts,
13801382
FeatureDot1Insts,
13811383
FeatureDot2Insts,
@@ -1491,16 +1493,17 @@ def FeatureISAVersion9_4_Common : FeatureSet<
14911493

14921494
def FeatureISAVersion9_5_Common : FeatureSet<
14931495
!listconcat(FeatureISAVersion9_4_Common.Features,
1494-
[FeatureFP8Insts,
1496+
[FeatureAddressableLocalMemorySize163840,
1497+
FeatureFP8Insts,
14951498
FeatureFP8ConversionInsts,
14961499
FeatureCvtFP8VOP1Bug,
14971500
FeatureGFX950Insts,
1498-
FeatureAddressableLocalMemorySize163840
14991501
])>;
15001502

15011503
def FeatureISAVersion9_4_0 : FeatureSet<
15021504
!listconcat(FeatureISAVersion9_4_Common.Features,
15031505
[
1506+
FeatureAddressableLocalMemorySize65536,
15041507
FeatureForceStoreSC0SC1,
15051508
FeatureFP8Insts,
15061509
FeatureFP8ConversionInsts,
@@ -1511,6 +1514,7 @@ def FeatureISAVersion9_4_0 : FeatureSet<
15111514
def FeatureISAVersion9_4_1 : FeatureSet<
15121515
!listconcat(FeatureISAVersion9_4_Common.Features,
15131516
[
1517+
FeatureAddressableLocalMemorySize65536,
15141518
FeatureForceStoreSC0SC1,
15151519
FeatureFP8Insts,
15161520
FeatureFP8ConversionInsts,
@@ -1521,6 +1525,7 @@ def FeatureISAVersion9_4_1 : FeatureSet<
15211525
def FeatureISAVersion9_4_2 : FeatureSet<
15221526
!listconcat(FeatureISAVersion9_4_Common.Features,
15231527
[
1528+
FeatureAddressableLocalMemorySize65536,
15241529
FeatureFP8Insts,
15251530
FeatureFP8ConversionInsts,
15261531
FeatureCvtFP8VOP1Bug,
@@ -1529,7 +1534,8 @@ def FeatureISAVersion9_4_2 : FeatureSet<
15291534

15301535
def FeatureISAVersion9_4_Generic : FeatureSet<
15311536
!listconcat(FeatureISAVersion9_4_Common.Features,
1532-
[FeatureRequiresCOV6])>;
1537+
[FeatureAddressableLocalMemorySize65536,
1538+
FeatureRequiresCOV6])>;
15331539

15341540
def FeatureISAVersion9_5_0 : FeatureSet<FeatureISAVersion9_5_Common.Features>;
15351541

llvm/test/CodeGen/AMDGPU/lds-limit-diagnostics-gfx950.ll

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx950 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERROR-LIMIT160K %s
2+
; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx9-4-generic -filetype=null %s 2>&1 | FileCheck -check-prefix=ERROR-LIMIT64K %s
3+
; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx9-generic -filetype=null %s 2>&1 | FileCheck -check-prefix=ERROR-LIMIT64K %s
4+
; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx940 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERROR-LIMIT64K %s
5+
; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx941 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERROR-LIMIT64K %s
6+
; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx942 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERROR-LIMIT64K %s
7+
; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERROR-LIMIT64K %s
8+
; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx906 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERROR-LIMIT64K %s
9+
; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERROR-LIMIT64K %s
10+
; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a -filetype=null %s 2>&1 | FileCheck -check-prefix=ERROR-LIMIT64K %s
11+
; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90c -filetype=null %s 2>&1 | FileCheck -check-prefix=ERROR-LIMIT64K %s
12+
; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1010 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERROR-LIMIT64K %s
13+
; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1030 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERROR-LIMIT64K %s
14+
; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERROR-LIMIT64K %s
15+
; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1200 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERROR-LIMIT64K %s
16+
; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx803 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERROR-LIMIT64K %s
17+
; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx700 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERROR-LIMIT64K %s
18+
; RUN: not llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx600 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERROR-LIMIT32K %s
19+
20+
; gfx950 supports upto 160 KB LDS memory. The generic target does not.
21+
; This is a negative test to check when the LDS size exceeds the max usable limit.
22+
23+
; ERROR-LIMIT160K: error: <unknown>:0:0: local memory (163844) exceeds limit (163840) in function 'test_lds_limit'
24+
; ERROR-LIMIT64K: error: <unknown>:0:0: local memory (163844) exceeds limit (65536) in function 'test_lds_limit'
25+
; ERROR-LIMIT32K: error: <unknown>:0:0: local memory (163844) exceeds limit (32768) in function 'test_lds_limit'
26+
@dst = addrspace(3) global [40961 x i32] poison
27+
28+
define amdgpu_kernel void @test_lds_limit(i32 %val) {
29+
%gep = getelementptr [40961 x i32], ptr addrspace(3) @dst, i32 0, i32 100
30+
store i32 %val, ptr addrspace(3) %gep
31+
ret void
32+
}

0 commit comments

Comments
 (0)