[llvm] dc3882e - [AMDGPU] Fix .amdhsa_shared_vgpr_count error checking for GFX11

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 14 02:05:39 PDT 2023


Author: Jay Foad
Date: 2023-03-14T09:05:32Z
New Revision: dc3882eace54afb086adc4164d7d916b164d22d5

URL: https://github.com/llvm/llvm-project/commit/dc3882eace54afb086adc4164d7d916b164d22d5
DIFF: https://github.com/llvm/llvm-project/commit/dc3882eace54afb086adc4164d7d916b164d22d5.diff

LOG: [AMDGPU] Fix .amdhsa_shared_vgpr_count error checking for GFX11

Differential Revision: https://reviews.llvm.org/D145936

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
    llvm/test/MC/AMDGPU/hsa-diag-v3.s

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
index c9dc8aade7c7..aba632aa5a03 100644
--- a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+++ b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
@@ -5315,7 +5315,7 @@ bool AMDGPUAsmParser::ParseDirectiveAMDHSAKernel() {
                     (AccumOffset / 4 - 1));
   }
 
-  if (IVersion.Major == 10) {
+  if (IVersion.Major >= 10) {
     // SharedVGPRCount < 16 checked by PARSE_ENTRY_BITS
     if (SharedVGPRCount && EnableWavefrontSize32) {
       return TokError("shared_vgpr_count directive not valid on "

diff  --git a/llvm/test/MC/AMDGPU/hsa-diag-v3.s b/llvm/test/MC/AMDGPU/hsa-diag-v3.s
index aef2ecadb167..369ac905ad2b 100644
--- a/llvm/test/MC/AMDGPU/hsa-diag-v3.s
+++ b/llvm/test/MC/AMDGPU/hsa-diag-v3.s
@@ -1,13 +1,15 @@
-// RUN: not llvm-mc --amdhsa-code-object-version=3 -triple amdgcn-amd-amdhsa -mcpu=gfx810 -mattr=+xnack -show-encoding %s 2>&1 >/dev/null | FileCheck %s --check-prefixes=GCN,GFX8,NONGFX10,AMDHSA
-// RUN: not llvm-mc --amdhsa-code-object-version=3 -triple amdgcn-amd-amdhsa -mcpu=gfx1010 -mattr=+xnack -show-encoding %s 2>&1 >/dev/null | FileCheck %s --check-prefixes=GCN,GFX10,AMDHSA
+// RUN: not llvm-mc --amdhsa-code-object-version=3 -triple amdgcn-amd-amdhsa -mcpu=gfx810 -mattr=+xnack -show-encoding %s 2>&1 >/dev/null | FileCheck %s --check-prefixes=GCN,GFX8,PREGFX10,AMDHSA
+// RUN: not llvm-mc --amdhsa-code-object-version=3 -triple amdgcn-amd-amdhsa -mcpu=gfx1010 -mattr=+xnack -show-encoding %s 2>&1 >/dev/null | FileCheck %s --check-prefixes=GCN,GFX10PLUS,GFX10,AMDHSA
+// RUN: not llvm-mc --amdhsa-code-object-version=3 -triple amdgcn-amd-amdhsa -mcpu=gfx1100 -show-encoding %s 2>&1 >/dev/null | FileCheck %s --check-prefixes=GCN,GFX10PLUS,GFX11,AMDHSA
 // RUN: not llvm-mc --amdhsa-code-object-version=3 -triple amdgcn-amd- -mcpu=gfx810 -mattr=+xnack -show-encoding %s 2>&1 >/dev/null | FileCheck %s --check-prefixes=GCN,NONAMDHSA
-// RUN: not llvm-mc --amdhsa-code-object-version=3 -triple amdgcn-amd-amdhsa -mcpu=gfx90a -mattr=+xnack -show-encoding %s 2>&1 >/dev/null | FileCheck %s --check-prefixes=GFX90A,NONGFX10,AMDHSA,ALL
+// RUN: not llvm-mc --amdhsa-code-object-version=3 -triple amdgcn-amd-amdhsa -mcpu=gfx90a -mattr=+xnack -show-encoding %s 2>&1 >/dev/null | FileCheck %s --check-prefixes=GFX90A,PREGFX10,AMDHSA,ALL
 
 .text
 
 // GCN-LABEL: warning: test_target
 // GFX8-NOT: error:
 // GFX10: error: .amdgcn_target directive's target id amdgcn-amd-amdhsa--gfx810+xnack does not match the specified target id amdgcn-amd-amdhsa--gfx1010+xnack
+// GFX11: error: .amdgcn_target directive's target id amdgcn-amd-amdhsa--gfx810+xnack does not match the specified target id amdgcn-amd-amdhsa--gfx1100
 // NONAMDHSA: error: .amdgcn_target directive's target id amdgcn-amd-amdhsa--gfx810+xnack does not match the specified target id amdgcn-amd-unknown--gfx810
 .warning "test_target"
 .amdgcn_target "amdgcn-amd-amdhsa--gfx810+xnack"
@@ -154,8 +156,8 @@
 .end_amdhsa_kernel
 
 // ALL-LABEL: warning: test_amdhsa_wavefront_size32
-// NONGFX10: error: directive requires gfx10+
-// GFX10: error: .amdhsa_next_free_vgpr directive is required
+// PREGFX10: error: directive requires gfx10+
+// GFX10PLUS: error: .amdhsa_next_free_vgpr directive is required
 // NONAMDHSA: error: unknown directive
 .warning "test_amdhsa_wavefront_size32"
 .amdhsa_kernel test_amdhsa_wavefront_size32
@@ -163,8 +165,8 @@
 .end_amdhsa_kernel
 
 // GCN-LABEL: warning: test_amdhsa_wavefront_size32_invalid
-// NONGFX10: error: directive requires gfx10+
-// GFX10: error: value out of range
+// PREGFX10: error: directive requires gfx10+
+// GFX10PLUS: error: value out of range
 // NONAMDHSA: error: unknown directive
 .warning "test_amdhsa_wavefront_size32_invalid"
 .amdhsa_kernel test_amdhsa_wavefront_size32_invalid
@@ -172,8 +174,8 @@
 .end_amdhsa_kernel
 
 // GCN-LABEL: warning: test_amdhsa_workgroup_processor_mode
-// NONGFX10: error: directive requires gfx10+
-// GFX10: error: .amdhsa_next_free_vgpr directive is required
+// PREGFX10: error: directive requires gfx10+
+// GFX10PLUS: error: .amdhsa_next_free_vgpr directive is required
 // NONAMDHSA: error: unknown directive
 .warning "test_amdhsa_workgroup_processor_mode"
 .amdhsa_kernel test_amdhsa_workgroup_processor_mode
@@ -181,8 +183,8 @@
 .end_amdhsa_kernel
 
 // GCN-LABEL: warning: test_amdhsa_workgroup_processor_mode_invalid
-// NONGFX10: error: directive requires gfx10+
-// GFX10: error: value out of range
+// PREGFX10: error: directive requires gfx10+
+// GFX10PLUS: error: value out of range
 // NONAMDHSA: error: unknown directive
 .warning "test_amdhsa_workgroup_processor_mode_invalid"
 .amdhsa_kernel test_amdhsa_workgroup_processor_mode_invalid
@@ -190,8 +192,8 @@
 .end_amdhsa_kernel
 
 // GCN-LABEL: warning: test_amdhsa_memory_ordered
-// NONGFX10: error: directive requires gfx10+
-// GFX10: error: .amdhsa_next_free_vgpr directive is required
+// PREGFX10: error: directive requires gfx10+
+// GFX10PLUS: error: .amdhsa_next_free_vgpr directive is required
 // NONAMDHSA: error: unknown directive
 .warning "test_amdhsa_memory_ordered"
 .amdhsa_kernel test_amdhsa_memory_ordered
@@ -199,8 +201,8 @@
 .end_amdhsa_kernel
 
 // GCN-LABEL: warning: test_amdhsa_memory_ordered_invalid
-// NONGFX10: error: directive requires gfx10+
-// GFX10: error: value out of range
+// PREGFX10: error: directive requires gfx10+
+// GFX10PLUS: error: value out of range
 // NONAMDHSA: error: unknown directive
 .warning "test_amdhsa_memory_ordered_invalid"
 .amdhsa_kernel test_amdhsa_memory_ordered_invalid
@@ -208,8 +210,8 @@
 .end_amdhsa_kernel
 
 // GCN-LABEL: warning: test_amdhsa_forward_progress
-// NONGFX10: error: directive requires gfx10+
-// GFX10: error: .amdhsa_next_free_vgpr directive is required
+// PREGFX10: error: directive requires gfx10+
+// GFX10PLUS: error: .amdhsa_next_free_vgpr directive is required
 // NONAMDHSA: error: unknown directive
 .warning "test_amdhsa_forward_progress"
 .amdhsa_kernel test_amdhsa_forward_progress
@@ -217,8 +219,8 @@
 .end_amdhsa_kernel
 
 // GCN-LABEL: warning: test_amdhsa_forward_progress_invalid
-// NONGFX10: error: directive requires gfx10+
-// GFX10: error: value out of range
+// PREGFX10: error: directive requires gfx10+
+// GFX10PLUS: error: value out of range
 // NONAMDHSA: error: unknown directive
 .warning "test_amdhsa_forward_progress_invalid"
 .amdhsa_kernel test_amdhsa_forward_progress_invalid
@@ -226,8 +228,8 @@
 .end_amdhsa_kernel
 
 // GCN-LABEL: warning: test_amdhsa_shared_vgpr_count_invalid1
-// NONGFX10: error: directive requires gfx10+
-// GFX10: error: .amdhsa_next_free_vgpr directive is required
+// PREGFX10: error: directive requires gfx10+
+// GFX10PLUS: error: .amdhsa_next_free_vgpr directive is required
 // NONAMDHSA: error: unknown directive
 .warning "test_amdhsa_shared_vgpr_count_invalid1"
 .amdhsa_kernel test_amdhsa_shared_vgpr_count_invalid1
@@ -235,8 +237,8 @@
 .end_amdhsa_kernel
 
 // GCN-LABEL: warning: test_amdhsa_shared_vgpr_count_invalid2
-// NONGFX10: error: directive requires gfx10+
-// GFX10: error: shared_vgpr_count directive not valid on wavefront size 32
+// PREGFX10: error: directive requires gfx10+
+// GFX10PLUS: error: shared_vgpr_count directive not valid on wavefront size 32
 // NONAMDHSA: error: unknown directive
 .warning "test_amdhsa_shared_vgpr_count_invalid2"
 .amdhsa_kernel test_amdhsa_shared_vgpr_count_invalid2
@@ -247,8 +249,8 @@
 .end_amdhsa_kernel
 
 // GCN-LABEL: warning: test_amdhsa_shared_vgpr_count_invalid3
-// NONGFX10: error: directive requires gfx10+
-// GFX10: error: value out of range
+// PREGFX10: error: directive requires gfx10+
+// GFX10PLUS: error: value out of range
 // NONAMDHSA: error: unknown directive
 .warning "test_amdhsa_shared_vgpr_count_invalid3"
 .amdhsa_kernel test_amdhsa_shared_vgpr_count_invalid3
@@ -258,8 +260,8 @@
 .end_amdhsa_kernel
 
 // GCN-LABEL: warning: test_amdhsa_shared_vgpr_count_invalid4
-// NONGFX10: error: directive requires gfx10+
-// GFX10: error: shared_vgpr_count*2 + compute_pgm_rsrc1.GRANULATED_WORKITEM_VGPR_COUNT cannot exceed 63
+// PREGFX10: error: directive requires gfx10+
+// GFX10PLUS: error: shared_vgpr_count*2 + compute_pgm_rsrc1.GRANULATED_WORKITEM_VGPR_COUNT cannot exceed 63
 // NONAMDHSA: error: unknown directive
 .warning "test_amdhsa_shared_vgpr_count_invalid4"
 .amdhsa_kernel test_amdhsa_shared_vgpr_count_invalid4


        


More information about the llvm-commits mailing list