M
Modular14mo ago
guraypp

Is it possible to use MLIR dialects?

Hi, I am trying to use MLIR dialects in mojo (other than index), I get unregistered dialect error. Is it possible to register other dialects? Also, is it possible to see generated MLIR?
def main():
let d = __mlir_attr.`true`
__mlir_op.`vector.print`[_type=__mlir_type.index](d)
def main():
let d = __mlir_attr.`true`
__mlir_op.`vector.print`[_type=__mlir_type.index](d)
error
$mojo guray.mojo
asd.mojo:22:54: error: use of unregistered MLIR operation 'vector.print'
__mlir_op.`vector.print`[_type=__mlir_type.index](d)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
mojo: error: failed to parse the provided Mojo
$mojo guray.mojo
asd.mojo:22:54: error: use of unregistered MLIR operation 'vector.print'
__mlir_op.`vector.print`[_type=__mlir_type.index](d)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
mojo: error: failed to parse the provided Mojo
3 Replies
ihnorton
ihnorton14mo ago
Only index and llvm dialects are shipped/available right now: - https://github.com/modularml/mojo/issues/1064#issuecomment-1766939631 - https://docs.modular.com/mojo/roadmap.html#only-certain-loaded-mlir-dialects-can-be-accessed I haven't seen any way to dump generated MLIR.
Modular Docs - Mojo🔥 roadmap & sharp edges
A summary of our Mojo plans, including upcoming features and things we need to fix.
GitHub
[BUG]: `error: unable to infer result type from MLIR operation 'cf....
Bug description I am attempting to create my own U8 which represents an unsigned 8-bits integer. For the add dunder method, as Mojo doesn't allow for raises context within alias initializat...
ihnorton
ihnorton14mo ago
GitHub
Issues · modularml/mojo
The Mojo Programming Language. Contribute to modularml/mojo development by creating an account on GitHub.
guraypp
gurayppOP14mo ago
Thanks, I am looking for this feature
Want results from more Discord servers?
Add your server