[Mlir-commits] [mlir] 814b605 - [mlir][AMDGPU] Add AMDGPU conversion patterns to ConvertGPUToROCDL

Krzysztof Drewniak llvmlistbot at llvm.org
Tue May 10 09:49:17 PDT 2022


Author: Krzysztof Drewniak
Date: 2022-05-10T16:49:11Z
New Revision: 814b60509599614ba767cf0afef119cdbb7c4df8

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

LOG: [mlir][AMDGPU] Add AMDGPU conversion patterns to ConvertGPUToROCDL

This ensures that attributes such as the index bitwidth propagate
correctly to the AMDGPUToROCDL patterns.

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

Added: 
    

Modified: 
    mlir/lib/Conversion/GPUToROCDL/CMakeLists.txt
    mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp
    utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Conversion/GPUToROCDL/CMakeLists.txt b/mlir/lib/Conversion/GPUToROCDL/CMakeLists.txt
index 86fd184243e6e..fc34508c5ba2b 100644
--- a/mlir/lib/Conversion/GPUToROCDL/CMakeLists.txt
+++ b/mlir/lib/Conversion/GPUToROCDL/CMakeLists.txt
@@ -11,6 +11,7 @@ add_mlir_conversion_library(MLIRGPUToROCDLTransforms
 
   LINK_LIBS PUBLIC
   MLIRArithmeticToLLVM
+  MLIRAMDGPUToROCDL
   MLIRFuncToLLVM
   MLIRGPUOps
   MLIRGPUToGPURuntimeTransforms

diff  --git a/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp b/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp
index c473ef32393c6..9aec6afb90cc9 100644
--- a/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp
+++ b/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp
@@ -14,6 +14,7 @@
 #include "mlir/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.h"
 #include "mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h"
 
+#include "mlir/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.h"
 #include "mlir/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.h"
 #include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h"
 #include "mlir/Conversion/LLVMCommon/ConversionTarget.h"
@@ -79,6 +80,7 @@ struct LowerGpuOpsToROCDLOpsPass
 
     mlir::arith::populateArithmeticToLLVMConversionPatterns(converter,
                                                             llvmPatterns);
+    populateAMDGPUToROCDLConversionPatterns(converter, llvmPatterns);
     populateVectorToLLVMConversionPatterns(converter, llvmPatterns);
     populateVectorToROCDLConversionPatterns(converter, llvmPatterns);
     cf::populateControlFlowToLLVMConversionPatterns(converter, llvmPatterns);

diff  --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
index 3a208b7ace27d..e187d3b275338 100644
--- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
@@ -3798,6 +3798,7 @@ cc_library(
     includes = ["include"],
     deps = [
         ":ArithmeticToLLVM",
+        ":AMDGPUToROCDL",
         ":ControlFlowToLLVM",
         ":ConversionPassIncGen",
         ":FuncDialect",


        


More information about the Mlir-commits mailing list