I am working on a ‘mytoy’ dialect for learning purposes and want to register it with mlir. When I try to use mlir-opt I get following error:
error: Dialect `mytoy' not found for custom op 'mytoy.constant' ........
note: Registered dialects: acc, affine, amdgpu, amx, arith, arm_neon, arm_sve, async, bufferization, builtin, cf, complex, dlti, emitc, func, gpu, index, linalg, llvm, math, memref, ml_program, nvgpu, nvvm, omp, pdl, pdl_interp, quant, rocdl, scf, shape, sparse_tensor, spirv, tensor, test, test_dyn, tosa, transform, vector, x86vector ; for more info on dialect registration see https://mlir.llvm.org/getting_started/Faq/#registered-loaded-dependent-whats-up-with-dialects-management
This document states that :
“Finally, dialects can be registered with the context. The sole purpose of the registration is to make these dialects available for the textual parser used by tools like mlir-opt
or mlir-translate
”
How can I register my dialect with the context as stated in this document, so that the parser can recognize it?