[Mlir-commits] [mlir] [mlir][Interfaces][NFC] Update doc of ViewLikeOpInterface parser/printer handlers (PR #122555)
Matthias Springer
llvmlistbot at llvm.org
Sat Jan 11 01:25:36 PST 2025
================
@@ -113,64 +135,72 @@ inline void printDynamicIndexList(
OpAsmPrinter &printer, Operation *op, OperandRange values,
ArrayRef<int64_t> integers, TypeRange valueTypes = TypeRange(),
AsmParser::Delimiter delimiter = AsmParser::Delimiter::Square) {
- return printDynamicIndexList(printer, op, values, integers, {}, valueTypes,
- delimiter);
+ return printDynamicIndexList(printer, op, values, integers, /*scalables=*/{},
+ valueTypes, delimiter);
}
-/// Parser hook for custom directive in assemblyFormat.
+/// Parser hooks for custom directive in assemblyFormat.
///
/// custom<DynamicIndexList>($values, $integers)
/// custom<DynamicIndexList>($values, $integers, type($values))
///
/// where `values` is of ODS type `Variadic<*>` and `integers` is of ODS
-/// type `I64ArrayAttr`. Parse a mixed list with either (1) static integer
-/// values or (2) SSA values. Fill `integers` with the integer ArrayAttr, where
-/// `kDynamic` encodes the position of SSA values. Add the parsed SSA values
-/// to `values` in-order. If `valueTypes` is non-null, fill it with types
-/// corresponding to values; otherwise the caller must handle the types.
-///
-/// E.g. after parsing "[%arg0 : index, 7, 42, %arg42 : i32]":
-/// 1. `result` is filled with the i64 ArrayAttr "[`kDynamic`, 7, 42,
-/// `kDynamic`]"
-/// 2. `ssa` is filled with "[%arg0, %arg1]".
-///
-/// Indices can be scalable. For example, "4" in "[2, [4], 8]" is scalable.
-/// This notation is similar to how scalable dims are marked when defining
-/// Vectors. For each value in `integers`, the corresponding `bool` in
-/// `scalableVals` encodes whether it's a scalable index.
+/// type `I64ArrayAttr`. Parse a mixed list where each element is either a
+/// static integer or an SSA value. Fill `integers` with the integer ArrayAttr,
+/// where `kDynamic` encodes the position of SSA values. Add the parsed SSA
+/// values to `values` in-order.
+///
+/// If `valueTypes` is provided, fill it with the types corresponding to each
----------------
matthias-springer wrote:
Maybe worth noting that if `valueTypes` is not provided, types are not parsed at all. I.e., `%arg0 : index` is a syntax error.
https://github.com/llvm/llvm-project/pull/122555
More information about the Mlir-commits
mailing list