Issue 149662
Summary Print affine map and set evaluations in human-readable format
Labels new issue
Assignees
Reporter mdehling
    Affine maps and sets, by default, are printed as map/set separately, with following lists of dimension and symbol operands:
```mlir
affine.for %i = 0 to min affine_map<(d0, d1)[s0] -> (d1 floordiv s0, d0)>(%i, %j)[%k]
```
Even worse, the map may be printed separately and a reference `#mymap1` used here.  This makes it very hard for a human to read the IR.

Instead, I would like to print all such evaluations in the same way as when using `printAffineMapOfSSAIds`.  So the above should look like this instead:
```mlir
affine.for %i = 0 to min [%j floordiv symbol(%k), %i]
```

I understand this breaks round-tripping, but I think we could add a command line option to control this printer behavior.

Suggestion: introduce `printAffineMapEvaluation` and `printAffineSetEvaluation` and a printer flag to control behavior.  With the flag set to false, both print the current format `affine_set<...>(%i, ...)[%k, ...]`, while with the flag set to true, both print the more human readable format.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to