Skip to content
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

Affine map util #35

Closed
wants to merge 1 commit into from
Closed

Affine map util #35

wants to merge 1 commit into from

Conversation

Pangoraw
Copy link
Member

Not sure if we want to include this but this works like this:

julia> using MLIR: IR, AffineUtils

julia> IR.context!(IR.Context()) do
           AffineUtils.@map (d1, d2)[s0] -> (d1 + s0, d2 % 10)
       end
MLIR.IR.AffineMap(#= (d0, d1)[s0] -> (d0 + s0, d1 mod 10) =#)

Copy link
Member

@mofeing mofeing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move all this to the IR folder and remove the AffineUtils module maybe. Or just use that module for the walk function.

src/Affine.jl Show resolved Hide resolved
src/MLIR.jl Show resolved Hide resolved
Copy link
Member

@mofeing mofeing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move all this to the IR folder and remove the AffineUtils module maybe. Or just use that module for the walk function.

@mofeing mofeing mentioned this pull request Feb 27, 2024
4 tasks
mofeing added a commit that referenced this pull request Feb 28, 2024
@mofeing
Copy link
Member

mofeing commented Feb 28, 2024

@Pangoraw I've integrated these changes into #62

@Pangoraw
Copy link
Member Author

@Pangoraw I've integrated these changes into #62

Great! Thanks

@Pangoraw Pangoraw closed this Feb 28, 2024
@Pangoraw Pangoraw deleted the pb/affine_map_utils branch February 28, 2024 18:44
mofeing added a commit that referenced this pull request Mar 8, 2024
* Reimplement `Context`

* Reimplement `Dialect`

* Reimplement `Location`

* Reimplement `Value`

* Reimplement `Block`

* Move `BlockIterator`

* Refactor `first_op`

* Refactor `mlirIsNull` calls in `Block`

* Reimplement `Region`

* Reimplement `Module`

* Fix namespaces in `Location`

* Refactor `Type` to `Core.Type` to avoid import

* Remove unused arg name from `iterator(::BlockIterator)`

* Fix namespace calls under `API`

* Refactor constructors

* Refactor `Context` code

* Refactor `Dialect` code

* Fix typo in exported symbol

* Fix typo in returned value in `enable_multithreading!`

* Document some code

* Refactor code

* Reimplement `Operation`

* Remove commented code

* Export symbols from `IR`

* Reimplement `TypeID`

* Move iterators to new file

* Fix missing module name in function calls

* Remove `MLIRType` from tblgen generator

* Refactor `MLIRType` from brutus example

* Remove duplicate `get_or_load_dialect!` method

* Fix missing module name in symbol refs

* Refactor `MLIRType` in tests

* Add `Identifier`

* Add `SymbolTable`

* Implement `IntegerSet`

* Add `AffineExpr` type

* Throw message on assert fail in `AffineExpr` constructor

* Add `AffineMap` type

* Fix `Context` kwargs

* Import `@affinemap` macro from #35

Co-authored-by: Paul Berg <[email protected]>

* Fix `@affinemap`

* Implement `LogicalResult`

* Fix typo in `move_after!`

* Add `rmfromparent!` for `Operation`

* Reimplement `Type`

* Reorder includes

* Fix `Type` clash in `LogicalResult`

* Reimplement `Attribute`

* Refactor `MLIRType` to `IR.Type` in dialect bindings

* Fix `mlir*IsNull` calls

`mlir*IsNull` are only defined in headers (no symbol in libs), so binding is generated but fails to look for the symbol

* Apply suggestion from @Pangoraw

Co-authored-by: Paul Berg <[email protected]>

* Apply suggestion from @Pangoraw

Co-authored-by: Paul Berg <[email protected]>

* Apply suggestion by @Pangoraw

Co-authored-by: Paul Berg <[email protected]>

* Fix typos

* Fix ambiguity

* Fix typos

* Remove redundant exports

* Fix type value retrieval of `Attribute` for integers

* Apply suggestion by @Pangoraw

* Refactor `@affinemap`

* Remove invalid assert in `@affinemap`

* Fix extra namespace inside macro

* Fix `mlir_str` macro

* Fix `verifyall`

* Rename `next_in_region` to `next`

* Add `OpOperand` type (LLVM 16)

* Fix `mlirOpPrintingFlagsEnableDebugInfo` on LLVM 15,16

* Add `@llvmversioned` macro utility

* Add Float8 types

* Add support for `DenseArray` attributes

* Remove `isopaquelements` on LLVM 16

* Fix typos in `OpOperand`

* Fix namespace in `DenseArrayAttribute`

* Refactor `operandsegmentsizes`

* Fix import in Julia 1.10

* Fix max versioning in `@llvmversioned`

* Fix `DenseElementsAttribute` docstrings

* Fix docstring warning in methods with `@llvmversioned`

* Fix docstring of `type`

* Fix `mlirIsNull` calls

* Fix `LogicalResult` methods

`mlirLogicalResult*` functions in the C-API are header-only

* Fix `LogicalResult` calls in pass infrastructure

* Update Brutus example

* Comment `mlirOperationWriteBytecode`

* Use signless integer types in MLIR for `<:Signed` types in Julia

* Fix `Bool` to MLIR conversion

* Fix tests

* Update docs

* Fix 0-indexing of dims and symbol expressions in `@affinemap`

* Refactor `PassManager`,`OpPassManager`

* Add `ExecutionEngine`

* Fix docstring of `Type(Complex{T})`

* Refactor `TensorType` constructor

* Refactor `push_argument!`

* Apply suggestion by @Pangoraw

Co-authored-by: Paul Berg <[email protected]>

* Refactor `create_operation`

* Fix `push_arguent!`

* Try fix `load_all_available_dialects` call in Julia 1.9

---------

Co-authored-by: Paul Berg <[email protected]>
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.

2 participants