History log of /llvm-project/mlir/lib/Dialect/Linalg/Transforms/Generalization.cpp (Results 1 – 25 of 44)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7
# 09dfc571 20-Dec-2024 Jacques Pienaar <jpienaar@google.com>

[mlir] Enable decoupling two kinds of greedy behavior. (#104649)

The greedy rewriter is used in many different flows and it has a lot of
convenience (work list management, debugging actions, tracin

[mlir] Enable decoupling two kinds of greedy behavior. (#104649)

The greedy rewriter is used in many different flows and it has a lot of
convenience (work list management, debugging actions, tracing, etc). But
it combines two kinds of greedy behavior 1) how ops are matched, 2)
folding wherever it can.

These are independent forms of greedy and leads to inefficiency. E.g.,
cases where one need to create different phases in lowering and is
required to applying patterns in specific order split across different
passes. Using the driver one ends up needlessly retrying folding/having
multiple rounds of folding attempts, where one final run would have
sufficed.

Of course folks can locally avoid this behavior by just building their
own, but this is also a common requested feature that folks keep on
working around locally in suboptimal ways.

For downstream users, there should be no behavioral change. Updating
from the deprecated should just be a find and replace (e.g., `find ./
-type f -exec sed -i
's|applyPatternsAndFoldGreedily|applyPatternsGreedily|g' {} \;` variety)
as the API arguments hasn't changed between the two.

show more ...


Revision tags: llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4
# 1e98d488 24-Feb-2024 Quinn Dawkins <quinn.dawkins@gmail.com>

[mlir][linalg] NFC: Use tablegen macro for pass constructors (#82892)

This uses the tablegen macros for generating pass constructors, exposing
pass options for fold-unit-extent-dims and linalg-dete

[mlir][linalg] NFC: Use tablegen macro for pass constructors (#82892)

This uses the tablegen macros for generating pass constructors, exposing
pass options for fold-unit-extent-dims and linalg-detensorize.

Additionally aligns some of the pass namings to their text counterpart.
This includes an API change:

createLinalgGeneralizationPass -> createLinalgGeneralizeNamedOpsPass

show more ...


Revision tags: llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init
# 0a8e3dd4 12-Jan-2024 Matthias Springer <me@m-sp.org>

[mlir][Interfaces] `DestinationStyleOpInterface`: Rename `hasTensor/BufferSemantics` (#77574)

Rename interface functions as follows:
* `hasTensorSemantics` -> `hasPureTensorSemantics`
* `hasBuffer

[mlir][Interfaces] `DestinationStyleOpInterface`: Rename `hasTensor/BufferSemantics` (#77574)

Rename interface functions as follows:
* `hasTensorSemantics` -> `hasPureTensorSemantics`
* `hasBufferSemantics` -> `hasPureBufferSemantics`

These two functions return "true" if the op has tensor/buffer operands
but not buffer/tensor operands.

Also drop the "ranked" part from the interface, i.e., do not distinguish
between ranked/unranked types.

The new function names describe the functions more accurately. They also
align their semantics with the notion of "tensor semantics" with the
bufferization framework. (An op is supposed to be bufferized if it has
tensor operands, and we don't care if it also has memref operands.)

This change is in preparation of #75273, which adds
`BufferizableOpInterface::hasTensorSemantics`. By renaming the functions
in the `DestinationStyleOpInterface`, we can avoid name clashes between
the two interfaces.

show more ...


Revision tags: llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2
# 0b2197b0 21-Sep-2023 Matthias Springer <me@m-sp.org>

[mlir][Interfaces] Clean up `DestinationStyleOpInterface` (#67015)

* "init" operands are specified with `MutableOperandRange` (which gives
access to the underlying `OpOperand *`). No more magic num

[mlir][Interfaces] Clean up `DestinationStyleOpInterface` (#67015)

* "init" operands are specified with `MutableOperandRange` (which gives
access to the underlying `OpOperand *`). No more magic numbers.
* Remove most interface methods and make them helper functions. Only
`getInitsMutable` should be implemented.
* Provide separate helper functions for accessing mutable/immutable
operands (`OpOperand`/`Value`, in line with #66515): `getInitsMutable`
and `getInits` (same naming convention as auto-generated op accessors).
`getInputOperands` was not renamed because this function cannot return a
`MutableOperandRange` (because the operands are not necessarily
consecutive). `OpOperandVector` is no longer needed.
* The new `getDpsInits`/`getDpsInitsMutable` is more efficient than the
old `getDpsInitOperands` because no `SmallVector` is created. The new
functions return a range of operands.
* Fix a bug in `getDpsInputOperands`: out-of-bounds operands were
potentially returned.

show more ...


Revision tags: llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init
# 6c3d0fa0 05-Jul-2023 Nicolas Vasilache <nicolasvasilache@users.noreply.github.com>

[mlir][Linalg] Relax restriction of Linalg passes on FuncOp

Existing Linalg passes are still anchoring on FuncOp.
Relax this unnecessary limitation.

Differential Revision: https://reviews.llvm.org/

[mlir][Linalg] Relax restriction of Linalg passes on FuncOp

Existing Linalg passes are still anchoring on FuncOp.
Relax this unnecessary limitation.

Differential Revision: https://reviews.llvm.org/D154497

show more ...


# 09d09fc3 21-Jun-2023 Lorenzo Chelini <l.chelini@icloud.com>

[MLIR][Linalg] Avoid generalizing `linalg.map`

We cannot trivially generalize `linalg.map`, as it does not use the
output as a region argument in the block, while `linalg.generic` expects
many regio

[MLIR][Linalg] Avoid generalizing `linalg.map`

We cannot trivially generalize `linalg.map`, as it does not use the
output as a region argument in the block, while `linalg.generic` expects
many region arguments as the input/output operands.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D153442

show more ...


Revision tags: llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1
# 46cfdfb5 29-Mar-2023 Nicolas Vasilache <nicolas.vasilache@gmail.com>

[mlir][Linalg] Fix Generalize transform

Generalize used to fail on ops that have a null region builder.
This is incorrect, the test should be whether the op has a region or not.
In the future we may

[mlir][Linalg] Fix Generalize transform

Generalize used to fail on ops that have a null region builder.
This is incorrect, the test should be whether the op has a region or not.
In the future we may want to support 0-region ops with a region builder.

Differential Revision: https://reviews.llvm.org/D147166

show more ...


Revision tags: llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5
# e6598b05 10-Nov-2022 Oleg Shyshkov <shyshkov@google.com>

Revert "Revert "[mlir][linalg] Replace "string" iterator_types attr with enums in LinalgInterface.""

With python code fixed.

This reverts commit 41280908e43d47903960c66237ab49caa5641b4d.


# 41280908 09-Nov-2022 Oleg Shyshkov <shyshkov@google.com>

Revert "[mlir][linalg] Replace "string" iterator_types attr with enums in LinalgInterface."

Breaks linalg python tests. Would need to also update python/mlir/dialects/linalg/opdsl.

This reverts com

Revert "[mlir][linalg] Replace "string" iterator_types attr with enums in LinalgInterface."

Breaks linalg python tests. Would need to also update python/mlir/dialects/linalg/opdsl.

This reverts commit b809d73973bb5aeedeb6a18cac2a7b3111d0c8d2.

show more ...


# b809d739 09-Nov-2022 Oleg Shyshkov <shyshkov@google.com>

[mlir][linalg] Replace "string" iterator_types attr with enums in LinalgInterface.

[RFC: EnumAttr for iterator types in Linalg](https://discourse.llvm.org/t/rfc-enumattr-for-iterator-types-in-linalg

[mlir][linalg] Replace "string" iterator_types attr with enums in LinalgInterface.

[RFC: EnumAttr for iterator types in Linalg](https://discourse.llvm.org/t/rfc-enumattr-for-iterator-types-in-linalg/64535)

This affect touches and probably breaks most of the code that creates `linalg.generic`. A fix would be to replace calls to `getParallelIteratorTypeName/getReductionIteratorTypeName` with `mlir::utils::IteratorType::parallel/reduction` and types from `StringRef` to `mlir::utils::IteratorType`.

Due to limitations of tablegen, shared C++ definition of IteratorType enum lives in StructuredOpsUtils.td, but each dialect should have it's own EnumAttr wrapper. To avoid conflict, all enums in a dialect are put into a separate file with a separate tablegen rule.

Test dialect td files are refactored a bit.

Printed format of `linalg.generic` temporarily remains unchanged to avoid breaking code and tests in the same change.

Differential Revision: https://reviews.llvm.org/D137658

show more ...


Revision tags: llvmorg-15.0.4
# b4db15a9 28-Oct-2022 Alexander Belyaev <pifon@google.com>

[mlir] Rename getInputs->getDpsInputs and getOutputs->getDpsInits in DPS interface.

https://discourse.llvm.org/t/rfc-interface-for-destination-style-ops/64056

Differential Revision: https://reviews

[mlir] Rename getInputs->getDpsInputs and getOutputs->getDpsInits in DPS interface.

https://discourse.llvm.org/t/rfc-interface-for-destination-style-ops/64056

Differential Revision: https://reviews.llvm.org/D136943

show more ...


Revision tags: llvmorg-15.0.3
# a7cccb9c 14-Oct-2022 Alexander Belyaev <pifon@google.com>

[mlir] Simplify DestinationStyleOpInterface.

Differential Revision: https://reviews.llvm.org/D135348


# bcfbf8cc 12-Oct-2022 Nicolas Vasilache <nicolas.vasilache@gmail.com>

[mlir][Linalg] NFC - Drop filter from LinalgGeneralizationPattern

Differential Revision: https://reviews.llvm.org/D135761


Revision tags: working, llvmorg-15.0.2
# 1e7a6c08 27-Sep-2022 Oleg Shyshkov <shyshkov@google.com>

[mlir][linalg] Add getIteratorTypesArray to LinalgInterface.

Summary:
Most of the code that gets `iterator_types` from LinalgInterface is forced to
extract values from an `Attribute`. As a result, t

[mlir][linalg] Add getIteratorTypesArray to LinalgInterface.

Summary:
Most of the code that gets `iterator_types` from LinalgInterface is forced to
extract values from an `Attribute`. As a result, the usage pattern looks like
this:

```
SmallVector<StringRef> iterators = llvm::to_vector<4>(linalgOp.iterator_types().getAsValueRange<StringAttr>());
```

It also forces all operations that implement LinalgOp interface to have
`iterator_types` attribute even when the information can be easily infered from
other parameters.

In perfect future, `getIteratorTypeArray` should be the only method to get
iterator types from the interface. The default implementation can rely on
`iterator_types` attribute though.

The name `getIteratorTypeArray` was picked to be consistent with existing
`getIndexingMapsArray`.

This patch add a few sample usages. More cleanups will follow.

Differential Revision: https://reviews.llvm.org/D134729

show more ...


Revision tags: llvmorg-15.0.1, llvmorg-15.0.0
# 67d0d7ac 31-Aug-2022 Michele Scuttari <michele.scuttari@outlook.com>

[MLIR] Update pass declarations to new autogenerated files

The patch introduces the required changes to update the pass declarations and definitions to use the new autogenerated files and allow drop

[MLIR] Update pass declarations to new autogenerated files

The patch introduces the required changes to update the pass declarations and definitions to use the new autogenerated files and allow dropping the old infrastructure.

Reviewed By: mehdi_amini, rriddle

Differential Review: https://reviews.llvm.org/D132838

show more ...


# 039b969b 30-Aug-2022 Michele Scuttari <michele.scuttari@outlook.com>

Revert "[MLIR] Update pass declarations to new autogenerated files"

This reverts commit 2be8af8f0e0780901213b6fd3013a5268ddc3359.


# 2be8af8f 30-Aug-2022 Michele Scuttari <michele.scuttari@outlook.com>

[MLIR] Update pass declarations to new autogenerated files

The patch introduces the required changes to update the pass declarations and definitions to use the new autogenerated files and allow drop

[MLIR] Update pass declarations to new autogenerated files

The patch introduces the required changes to update the pass declarations and definitions to use the new autogenerated files and allow dropping the old infrastructure.

Reviewed By: mehdi_amini, rriddle

Differential Review: https://reviews.llvm.org/D132838

show more ...


Revision tags: llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2
# d3b3f765 07-Aug-2022 Jacques Pienaar <jpienaar@google.com>

[mlir] Flip to prefixed accessors (NFC)


Revision tags: llvmorg-15.0.0-rc1, llvmorg-16-init
# d2c0572b 19-Jul-2022 Jacques Pienaar <jpienaar@google.com>

[mlir] Flip LinAlg dialect to _Both

This one required more changes than ideal due to overlapping generated name
with different return types. Changed getIndexingMaps to getIndexingMapsArray to
move i

[mlir] Flip LinAlg dialect to _Both

This one required more changes than ideal due to overlapping generated name
with different return types. Changed getIndexingMaps to getIndexingMapsArray to
move it out of the way/highlight that it returns (more expensively) a
SmallVector and uses the prefixed name for the Attribute.

Differential Revision: https://reviews.llvm.org/D129919

show more ...


Revision tags: llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2
# 58ceae95 18-Apr-2022 River Riddle <riddleriver@gmail.com>

[mlir:NFC] Remove the forward declaration of FuncOp in the mlir namespace

FuncOp has been moved to the `func` namespace for a little over a month, the
using directive can be dropped now.


Revision tags: llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2
# 41574554 04-Jan-2022 River Riddle <riddleriver@gmail.com>

[mlir][Pass] Deprecate FunctionPass in favor of OperationPass<FuncOp>

The only benefit of FunctionPass is that it filters out function
declarations. This isn't enough to justify carrying it around,

[mlir][Pass] Deprecate FunctionPass in favor of OperationPass<FuncOp>

The only benefit of FunctionPass is that it filters out function
declarations. This isn't enough to justify carrying it around, as we can
simplify filter out declarations when necessary within the pass. We can
also explore with better scheduling primitives to filter out declarations
at the pipeline level in the future.

The definition of FunctionPass is left intact for now to allow time for downstream
users to migrate.

Differential Revision: https://reviews.llvm.org/D117182

show more ...


# c05db638 05-Jan-2022 Nicolas Vasilache <ntv@google.com>

[mlir] Fix for 9a7d111f4fb65ad7343dcbd4f35ee608100634e8


# 9a7d111f 05-Jan-2022 Nicolas Vasilache <ntv@google.com>

[mlir][Linalg] NFC - Modernize transformation APIs.

Differential Revision: https://reviews.llvm.org/D116665


# 1fc096af 02-Jan-2022 Mehdi Amini <joker.eph@gmail.com>

Apply clang-tidy fixes for performance-unnecessary-value-param to MLIR (NFC)

Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D116250


# b7f2c108 15-Dec-2021 gysit <gysit@google.com>

[mlir][linalg] Replace LinalgOps.h and LinalgTypes.h by a single header.

After removing the range type, Linalg does not define any type. The revision thus consolidates the LinalgOps.h and LinalgType

[mlir][linalg] Replace LinalgOps.h and LinalgTypes.h by a single header.

After removing the range type, Linalg does not define any type. The revision thus consolidates the LinalgOps.h and LinalgTypes.h into a single Linalg.h header. Additionally, LinalgTypes.cpp is renamed to LinalgDialect.cpp to follow the convention adopted by other dialects such as the tensor dialect.

Depends On D115727

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D115728

show more ...


12