JuliaLabs / MLIR.jl

MIT License
56 stars 9 forks source link

Rename `MModule` to `Module` and add constructor from `module` operation #50

Closed jumerckx closed 9 months ago

jumerckx commented 9 months ago

This enables creating modules with attributes such as:

module attributes {transform.with_named_sequence} { ... }
vchuravy commented 9 months ago

Btw we could just name it Module instead of MModule.

vchuravy commented 9 months ago

Could you also add a test?

codecov-commenter commented 9 months ago

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (3fd9f2e) 3.07% compared to head (796a6e1) 1.89%.

Files Patch % Lines
src/IR/IR.jl 55.55% 4 Missing :warning:
src/IR/Support.jl 0.00% 1 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #50 +/- ## ======================================== - Coverage 3.07% 1.89% -1.19% ======================================== Files 107 107 Lines 26060 26038 -22 ======================================== - Hits 802 493 -309 - Misses 25258 25545 +287 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jumerckx commented 9 months ago

I renamed MModule to Module and added tests, are they thorough enough? Not sure how to get rid of: WARNING: using IR.Module in module Main conflicts with an existing identifier.

vchuravy commented 9 months ago

Are we doing a using LLVM?

Pangoraw commented 9 months ago

IIRC, I first called it MModule since otherwise it conflicted with Base.Module which is exported by Base and therefore Module was always ambiguous unless qualified.

We could do as LLVM and not export it:

julia> Base.isexported(LLVM, :Module)
false
jumerckx commented 9 months ago

Thanks, not exporting does the trick.

Pangoraw commented 9 months ago

I opened https://github.com/JuliaLang/julia/pull/53162 to allow doing:

using MLIR.IR: Module