Building Op isn't registered in this MLIRContext

I made some errors generating qmir.

I used ConstantOp.

I only registered my dialect and there is no definition of ConstantOp in my dialect.
Do I need to register the built-in dialect to use ConstantOp? How do I modify it?

Have a look at FAQ - MLIR

If you see this error from a pass, that means your pass should add the relevant dialect as “dependent dialect”. I suspect mlir::ConstantOp is in the StandardDialect in the version of MLIR you’re using.

1 Like

Thank you, this Op does belong to Standard. I also registered MLIRStandardOpDialect and the problem was solved