This patch adds an option to gen-op-defs and gen-op-decls called op-shard-count that, when set to a value greater than 1, splits the op class definitions into N shards and generates N registration functions, i.e. calls to addOperation<...>, guarded by the definition GET_OP_DEFS_<N>. It will also generate a top-level registration hook registerFooDialectOperations(FooDialect *) that calls each of the sharded registration hooks.
Sharding the op definitions and registration hooks can greatly speed up compilation time, especially for dialects with large opsets. To assist in sharding, a new buildrule is added (gentbl_sharded_ops in bazel and add_mlir_sharded_ops) which will copy a template source file and compile it multiple times with each shard.
Fixes #51789
Can you drop this using?