[PATCH] D74288: [MLIR][Affine] Add affine.parallel op

Jeremy Bruestle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 11 10:23:59 PST 2020


jbruestle requested changes to this revision.
jbruestle added inline comments.


================
Comment at: mlir/include/mlir/Dialect/AffineOps/AffineOps.td:307
+     I64ArrayAttr:$steps,
+     Variadic<Index>:$mapOperands);
+  let regions = (region SizedRegion<1>:$region);
----------------
flaub wrote:
> herhut wrote:
> > You could use `SameVariadicOperandSize` trait and then split the `mapOperands` into upper and lower bound here instead of implementing explicitly.
> Great, TIL :)
I don't see any reason that both maps would always take the same number of operands.  For example, if one wanted do:

```
affine.parallel (%i, %j) = (0,0) to (sym(N), sym(M)) {
  ...
}
```

which seems like a common enough use case, then `lowerBoundOperands` would be empty and `upperBoundOperands` would have 2 symbols.  I think the use of `SameVariadicOperandSize` should be reverted.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74288/new/

https://reviews.llvm.org/D74288





More information about the llvm-commits mailing list