zero9178 wrote: Thank you Alex!
> Why don't we just split the *Ops.td file in the first place? I know tablegen > itself is not on the compilation path, but may be more consistent between > files and easier on ODS magic. I am not sure how I didn't think of that, but your comment made me attempt to just split the test dialect without any changes in ODS and it works without issues for operations at least. I also like the symmetry of the cpp, td and header file. For comparisons sake I have opened a PR splitting the test dialect by splitting the tablegen file here: https://github.com/llvm/llvm-project/pull/239647 Benchmark results are more or less identical as you'd expect. The only major differences to this PR is that 1) the TableGen file needs to be split (good IMO), 2) registration is not automatic and requires helper functions and 3) forward declarations of other categories are not present. 1 is desireable IMO and 2 and 3 can be solved with other approaches as well and more incrementally than this PR. There is a bit of beauty in this PR in that TableGen is aware of the sharding and that it is a first-class construct, but I do think I am slightly in favour of the other PR though merely based on that it requires less and more incremental ODS changes. Lemme know what you think. > Should we deprecate and remove the existing sharding mechanism? It shouldn't > be hard to transition by simply introducing "shard 1" and "shard 2" for > dialects that don't want to bother with grouping operations semantically. I personally think so although benefits are more limited if one doesn't group semantically. If not grouping semantically, then people will continue including a large `<Dialect>Ops.h` header regardless of how many ops are being used from the dialect. No one wants to include a `<Dialect>Shard7.h` header to use some op. > One proposal: since we are introducing what is essentially a semantic > grouping of operations, it may be nice to leverage it to also organize the > generated documentation by groups, like LLVM IR LangRef does. There already is `OpDocGroup` https://github.com/llvm/llvm-project/blob/51d349fff30895dd76ba766706e9efad265063b4/mlir/include/mlir/IR/OpBase.td#L326 in TableGen that enables this. I was imaging that top-level `let` statements or base classes that set a doc group can also set the partition but didn't want to necessarily couple them. I don't have a strong opinion but agree that having two kinds of "semantic grouping" is awkward. Alternatively, we could get rid of `Partition` and reuse the `OpDocGroup` class? All it'd need is a name such that we can address it on the command line. This would also force users to make a semantically meaningful name https://github.com/llvm/llvm-project/pull/239254 _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
