[Mlir-commits] [mlir] 149dc94 - [mlir] fix the types used during the generation of the kernel param array

Tobias Gysi llvmlistbot at llvm.org
Wed Oct 7 07:26:02 PDT 2020


Author: Tobias Gysi
Date: 2020-10-07T16:18:46+02:00
New Revision: 149dc94c1d52c5f78e2aadb57a72dd437fe55aa1

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

LOG: [mlir] fix the types used during the generation of the kernel param array

The patch fixes the types used to access the elements of the kernel parameter structure from a pointer to the structure to a pointer to the actual parameter type.

Reviewed By: csigg

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

Added: 
    

Modified: 
    mlir/lib/Conversion/GPUCommon/ConvertLaunchFuncToRuntimeCalls.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Conversion/GPUCommon/ConvertLaunchFuncToRuntimeCalls.cpp b/mlir/lib/Conversion/GPUCommon/ConvertLaunchFuncToRuntimeCalls.cpp
index 56dc7d3f7c62..b25c2643f52e 100644
--- a/mlir/lib/Conversion/GPUCommon/ConvertLaunchFuncToRuntimeCalls.cpp
+++ b/mlir/lib/Conversion/GPUCommon/ConvertLaunchFuncToRuntimeCalls.cpp
@@ -279,9 +279,9 @@ Value ConvertLaunchFuncOpToGpuRuntimeCallPattern::generateParamsArray(
   for (auto en : llvm::enumerate(arguments)) {
     auto index = builder.create<LLVM::ConstantOp>(
         loc, llvmInt32Type, builder.getI32IntegerAttr(en.index()));
-    auto fieldPtr =
-        builder.create<LLVM::GEPOp>(loc, structType.getPointerTo(), structPtr,
-                                    ArrayRef<Value>{zero, index.getResult()});
+    auto fieldPtr = builder.create<LLVM::GEPOp>(
+        loc, argumentTypes[en.index()].getPointerTo(), structPtr,
+        ArrayRef<Value>{zero, index.getResult()});
     builder.create<LLVM::StoreOp>(loc, en.value(), fieldPtr);
     auto elementPtr = builder.create<LLVM::GEPOp>(loc, llvmPointerPointerType,
                                                   arrayPtr, index.getResult());


        


More information about the Mlir-commits mailing list