From: Uday Bondhugula Date: Sat, 17 Jun 2023 17:13:43 +0000 (+0530) Subject: [MLIR] Add support for bare pointer calling convention in gpu-to-llvm X-Git-Tag: upstream/17.0.6~4668 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=597f04fe97c838fb9e02aef299c48848273a3d1e;p=platform%2Fupstream%2Fllvm.git [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 --- diff --git a/mlir/include/mlir/Conversion/Passes.td b/mlir/include/mlir/Conversion/Passes.td index 7a6c6c7..a76aad8 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 8e922f5..05800ab 100644 --- a/mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp +++ b/mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp @@ -716,6 +716,7 @@ private: void GpuToLLVMConversionPass::runOnOperation() { LowerToLLVMOptions options(&getContext()); options.useOpaquePointers = useOpaquePointers; + options.useBarePtrCallConv = hostBarePtrCallConv; LLVMTypeConverter converter(&getContext(), options); RewritePatternSet patterns(&getContext());