melior icon indicating copy to clipboard operation
melior copied to clipboard

IRDL support for custom dialect definition

Open Moxinilian opened this issue 1 year ago • 4 comments

I am currently adding IRDL support for custom dialect definition to the C API, and once this has landed I'd like to add it to melior as well. Ideally a macro to generate useful Rust types from IRDL definitions would be really nice, but simply allowing to register custom dialects specified in IRDL would already be sufficient.

Moxinilian avatar May 11 '24 13:05 Moxinilian

As an update: I have managed to make this work on my fork of melior that uses LLVM 19. I assume there is no interest in LLVM 19-only features for now, so once LLVM 19 is released and supported in melior, I'll be able to submit a PR.

Moxinilian avatar May 21 '24 22:05 Moxinilian

This sounds excellent, @Moxinilian. I'm hoping for custom dialect support in melior soon. Do you have any resources or documentation available where I could see how this would be used in melior?

TyrsDev avatar Sep 14 '24 09:09 TyrsDev

Yes, basically it's just a matter of exposing mlirLoadIRDLDialects, which takes a ModuleOp and loads any IRDL dialect defined in it.

Moxinilian avatar Sep 14 '24 14:09 Moxinilian

LLVM 19.1.0 is out, https://github.com/llvm/llvm-project/releases/tag/llvmorg-19.1.0

ProfFan avatar Sep 22 '24 18:09 ProfFan