Skip to content

Refactor and clean IR module #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 99 commits into from
Mar 8, 2024
Merged

Refactor and clean IR module #62

merged 99 commits into from
Mar 8, 2024

Conversation

mofeing
Copy link
Member

@mofeing mofeing commented Feb 27, 2024

I've refactored the IR module so it's easier to maintain and read. I have renamed some functions for more Julia-like names. Also, I have added some missing methods in IR which use functionality from the C-API.

One of the biggest changes is that I've renamed MLIRType to Type. I found out that if we use Core.Type inside the IR module instead of the implicit Type, then there is no symbol clash. In order to avoid other clashes, this type is not exported so we need to access it like MLIR.IR.Type.

Some of these changes are opinionated, some of them not. Please, tell me your opinion.

New features

  • Added Identifier, SymbolTable, IntegerSet, AffineExpr, AffineMap types
  • MLIRType renamed to Type with no clash with Core.Type

To do

To do list for other PRs

  • Implement simplify(::AffineMap)
  • Add MemRefDescriptor
  • Refactor pass infrastructure
  • Missing Attributes:
    • StridedLayout
    • ResourceElementsAttr
  • Transform dialect support

@mofeing mofeing self-assigned this Feb 27, 2024
@mofeing
Copy link
Member Author

mofeing commented Mar 3, 2024

The Brutus example works now with this PR on both Julia 1.10 and 1.11

@codecov-commenter
Copy link

codecov-commenter commented Mar 3, 2024

Codecov Report

Attention: Patch coverage is 1.07256% with 3136 lines in your changes are missing coverage. Please review.

Project coverage is 2.72%. Comparing base (8267af4) to head (66e0a34).

Files Patch % Lines
src/Dialects/14/LLVMIR.jl 0.00% 433 Missing ⚠️
src/Dialects/14/Vector.jl 0.00% 266 Missing ⚠️
src/Dialects/14/Tosa.jl 0.00% 237 Missing ⚠️
src/Dialects/14/Linalg.jl 0.00% 214 Missing ⚠️
src/Dialects/14/PDLInterp.jl 0.00% 129 Missing ⚠️
src/Dialects/14/Arithmetic.jl 0.00% 128 Missing ⚠️
src/Dialects/15/Arithmetic.jl 12.21% 115 Missing ⚠️
src/Dialects/14/Shape.jl 0.00% 109 Missing ⚠️
src/Dialects/15/GPU.jl 0.00% 93 Missing ⚠️
src/Dialects/14/MemRef.jl 0.00% 86 Missing ⚠️
... and 32 more

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

Additional details and impacted files
@@           Coverage Diff            @@
##            main     #62      +/-   ##
========================================
+ Coverage   0.84%   2.72%   +1.87%     
========================================
  Files        107     125      +18     
  Lines      27916   28525     +609     
========================================
+ Hits         236     777     +541     
- Misses     27680   27748      +68     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mofeing mofeing marked this pull request as ready for review March 3, 2024 01:08
@mofeing mofeing merged commit 3527e24 into main Mar 8, 2024
@mofeing mofeing deleted the ssr/refactor branch March 8, 2024 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants