@@ -42,6 +42,8 @@ static mlir::Value createKernelArgArray(mlir::Location loc,
4242 auto structTy = mlir::LLVM::LLVMStructType::getLiteral (ctx, structTypes);
4343 auto ptrTy = mlir::LLVM::LLVMPointerType::get (rewriter.getContext ());
4444 mlir::Type i32Ty = rewriter.getI32Type ();
45+ auto zero = rewriter.create <mlir::LLVM::ConstantOp>(
46+ loc, i32Ty, rewriter.getIntegerAttr (i32Ty, 0 ));
4547 auto one = rewriter.create <mlir::LLVM::ConstantOp>(
4648 loc, i32Ty, rewriter.getIntegerAttr (i32Ty, 1 ));
4749 mlir::Value argStruct =
@@ -55,7 +57,8 @@ static mlir::Value createKernelArgArray(mlir::Location loc,
5557 auto indice = rewriter.create <mlir::LLVM::ConstantOp>(
5658 loc, i32Ty, rewriter.getIntegerAttr (i32Ty, i));
5759 mlir::Value structMember = rewriter.create <LLVM::GEPOp>(
58- loc, ptrTy, structTy, argStruct, mlir::ArrayRef<mlir::Value>({indice}));
60+ loc, ptrTy, structTy, argStruct,
61+ mlir::ArrayRef<mlir::Value>({zero, indice}));
5962 rewriter.create <LLVM::StoreOp>(loc, arg, structMember);
6063 mlir::Value arrayMember = rewriter.create <LLVM::GEPOp>(
6164 loc, ptrTy, ptrTy, argArray, mlir::ArrayRef<mlir::Value>({indice}));
0 commit comments