[Mlir-commits] [mlir] 597f04f - [MLIR] Add support for bare pointer calling convention in gpu-to-llvm

Uday Bondhugula llvmlistbot at llvm.org
Sat Jun 17 10:57:31 PDT 2023


Author: Uday Bondhugula
Date: 2023-06-17T23:27:13+05:30
New Revision: 597f04fe97c838fb9e02aef299c48848273a3d1e

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

LOG: [MLIR] Add support for bare pointer calling convention in gpu-to-llvm

Add support for the bare pointer calling convention in the gpu-to-llvm
pass. This wasn't being exposed and is needed when GPU-compiled MLIR is
to be called with this convention.

Reviewed By: krzysz00

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

Added: 
    

Modified: 
    mlir/include/mlir/Conversion/Passes.td
    mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Conversion/Passes.td b/mlir/include/mlir/Conversion/Passes.td
index 7a6c6c7fa8f3b..a76aad8c11e5c 100644
--- a/mlir/include/mlir/Conversion/Passes.td
+++ b/mlir/include/mlir/Conversion/Passes.td
@@ -361,6 +361,10 @@ def GpuToLLVMConversionPass : Pass<"gpu-to-llvm", "ModuleOp"> {
   }];
 
   let options = [
+    Option<"hostBarePtrCallConv", "use-bare-pointers-for-host", "bool",
+           /*default=*/"false",
+           "Use bare pointers to pass memref arguments to host functions. "
+           "All memrefs must have static shape.">,
     Option<"kernelBarePtrCallConv", "use-bare-pointers-for-kernels", "bool",
            /*default=*/"false",
              "Use bare pointers to pass memref arguments to kernels. "

diff  --git a/mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp b/mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp
index 8e922f54b5e27..05800aba8690f 100644
--- a/mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp
+++ b/mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp
@@ -716,6 +716,7 @@ class ConvertSDDMMOpToGpuRuntimeCallPattern
 void GpuToLLVMConversionPass::runOnOperation() {
   LowerToLLVMOptions options(&getContext());
   options.useOpaquePointers = useOpaquePointers;
+  options.useBarePtrCallConv = hostBarePtrCallConv;
 
   LLVMTypeConverter converter(&getContext(), options);
   RewritePatternSet patterns(&getContext());


        


More information about the Mlir-commits mailing list