[Mlir-commits] [mlir] [MLIR][XeGPU] make offsets optional for create_nd_tdesc (PR #148335)

Adam Siemieniuk llvmlistbot at llvm.org
Wed Jul 16 09:45:57 PDT 2025


================
@@ -112,6 +112,68 @@ isValidGatherScatterParams(Type maskTy, VectorType valueTy,
 //===----------------------------------------------------------------------===//
 // XeGPU_CreateNdDescOp
 //===----------------------------------------------------------------------===//
+
+void CreateNdDescOp::build(OpBuilder &builder, OperationState &state,
+                           Type tdesc, TypedValue<MemRefType> source) {
+  [[maybe_unused]] auto ty = source.getType();
+  assert(ty.hasStaticShape() && "expecting a memref with static shape");
+
+  build(builder, state, tdesc, source, ValueRange({}) /* dynamic offsets */,
+        ValueRange({}) /* empty dynamic shape */,
+        ValueRange({}) /* empty dynamic strides */,
+        builder.getDenseI64ArrayAttr({}) /* const offsets */,
----------------
adam-smnk wrote:

nit: I think you can just use `ValueRange{}` and `DenseI64ArrayAttr()` directly

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


More information about the Mlir-commits mailing list