[Mlir-commits] [mlir] [mlir][affine] Define `affine.linearize_index` (PR #114480)

Jakub Kuderski llvmlistbot at llvm.org
Mon Nov 4 09:25:38 PST 2024


================
@@ -1099,4 +1099,73 @@ def AffineDelinearizeIndexOp : Affine_Op<"delinearize_index",
   let hasCanonicalizer = 1;
 }
 
+//===----------------------------------------------------------------------===//
+// AffineLinearizeIndexOp
+//===----------------------------------------------------------------------===//
+def AffineLinearizeIndexOp : Affine_Op<"linearize_index",
+    [Pure, AttrSizedOperandSegments]> {
+  let summary = "linearize an index";
+  let description = [{
+    The `affine.linearize_index` operation takes a sequence of index values and a
+    basis of the same length and linearizes the indices using that basis.
+
+    That is, for indices %idx_1 through %i_N and basis elements b_1 through b_N,
+    it computes
----------------
kuhar wrote:

A few paragraph below you put variable names in verbatim, so it would be nice to keep it consistent across the documentation
```suggestion
    That is, for indices `%idx_1` through `%i_N` and basis elements `b_1` through `b_N`,
    it computes
```

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


More information about the Mlir-commits mailing list