[Mlir-commits] [mlir] 20c66a0 - [AMDGPU] Add basic support for gfx11xx

Krzysztof Drewniak llvmlistbot at llvm.org
Mon Jun 12 10:06:42 PDT 2023


Author: Giuseppe Rossini
Date: 2023-06-12T17:06:36Z
New Revision: 20c66a0c66340f44f04b6526e45bcc5d872d480a

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

LOG: [AMDGPU] Add basic support for gfx11xx

This patch fixes a minor issue in AMDGPUToROCDL to add gfx11 support in MLIR

Reviewed By: krzysz00

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

Added: 
    

Modified: 
    mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp
    mlir/test/Conversion/AMDGPUToROCDL/amdgpu-to-rocdl.mlir

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp b/mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp
index 1769b1fa82624..b518665581bb7 100644
--- a/mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp
+++ b/mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp
@@ -213,7 +213,7 @@ struct RawBufferOpLowering : public ConvertOpToLLVMPattern<GpuOp> {
     //  none, 3 = either swizzles or testing against offset field) RDNA only
     // bits 30-31: Type (must be 0)
     uint32_t word3 = (7 << 12) | (4 << 15);
-    if (chipset.majorVersion == 10) {
+    if (chipset.majorVersion >= 10) {
       word3 |= (1 << 24);
       uint32_t oob = adaptor.getBoundsCheck() ? 3 : 2;
       word3 |= (oob << 28);

diff  --git a/mlir/test/Conversion/AMDGPUToROCDL/amdgpu-to-rocdl.mlir b/mlir/test/Conversion/AMDGPUToROCDL/amdgpu-to-rocdl.mlir
index 1dbb70b015337..dda8a068857d5 100644
--- a/mlir/test/Conversion/AMDGPUToROCDL/amdgpu-to-rocdl.mlir
+++ b/mlir/test/Conversion/AMDGPUToROCDL/amdgpu-to-rocdl.mlir
@@ -1,5 +1,6 @@
 // RUN: mlir-opt %s -convert-amdgpu-to-rocdl=chipset=gfx908 | FileCheck %s
 // RUN: mlir-opt %s -convert-amdgpu-to-rocdl=chipset=gfx1030 | FileCheck %s --check-prefix=RDNA
+// RUN: mlir-opt %s -convert-amdgpu-to-rocdl=chipset=gfx1100 | FileCheck %s --check-prefix=RDNA
 
 // CHECK-LABEL: func @gpu_gcn_raw_buffer_load_scalar_i32
 func.func @gpu_gcn_raw_buffer_load_scalar_i32(%buf: memref<i32>) -> i32 {


        


More information about the Mlir-commits mailing list