[Mlir-commits] [mlir] [mlir][ArmSME] Add optional padding and mask operands to tile_load (PR #69195)

Benjamin Maxwell llvmlistbot at llvm.org
Mon Oct 16 10:49:57 PDT 2023


================
@@ -231,7 +231,24 @@ def ZeroOp : ArmSME_Op<"zero", [Pure]> {
   let assemblyFormat = "attr-dict `:` type($res)";
 }
 
-def TileLoadOp : ArmSME_Op<"tile_load"> {
+def TileLoadOp : ArmSME_Op<"tile_load", [
+  AttrSizedOperandSegments,
+  TypesMatchWith<
+    "padding type matches element type of result (if present)",
+    "result", "padding",
+    "::llvm::cast<VectorType>($_self).getElementType()",
+    "!getPadding() || std::equal_to<>()"
+  >,
+  TypesMatchWith<
+    "mask has i1 element type and same shape as result (if present)",
+    "result", "mask",
+    "VectorType("
+      "VectorType::Builder("
+        "::llvm::cast<mlir::VectorType>($_self)"
+      ").setElementType(IntegerType::get($_self.getContext(), 1)))",
----------------
MacDue wrote:

This is not just checking the type, it's used to infer the type of the mask from the result. That requires constructing the type (I believe).

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


More information about the Mlir-commits mailing list