[Mlir-commits] [mlir] [MLIR][XeGPU] Update the type of offsets for CreateDescOp and UpdateOffsetOp (PR #110741)

Adam Siemieniuk llvmlistbot at llvm.org
Wed Oct 2 07:04:55 PDT 2024


================
@@ -308,6 +309,24 @@ LogicalResult UpdateNdOffsetOp::verify() {
 // XeGPU_CreateDescOp
 //===----------------------------------------------------------------------===//
 
+void CreateDescOp::build(OpBuilder &builder, OperationState &state,
+                         TensorDescType TensorDesc, Value source,
+                         llvm::ArrayRef<OpFoldResult> offsets) {
+  auto loc = source.getLoc();
+  int64_t size = static_cast<int64_t>(offsets.size());
+  auto type = VectorType::get(size, builder.getIndexType());
+  auto values = getValueOrCreateConstantIndexOp(builder, loc, offsets);
+  auto offset = builder.create<vector::FromElementsOp>(loc, type, values);
----------------
adam-smnk wrote:

nit: is this necessary? Seems like weird dialect coupling

https://github.com/llvm/llvm-project/pull/110741


More information about the Mlir-commits mailing list