History log of /llvm-project/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp (Results 1 – 25 of 60)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7
# 35c5e56b 08-Jan-2025 Benjamin Kramer <benny.kra@googlemail.com>

Clean up -Wdangling-assignment-gsl in clang and mlir

These are triggering after b037bceef6a40c5c00c1f67cc5a334e2c4e5e041.


# 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
# be750200 23-Nov-2024 Uday Bondhugula <uday@polymagelabs.com>

[MLIR] Fix unchecked use of memref memory space attr in affine data copy generate (#116763)

Fix unchecked use of memref memory space attr in affine data copy
generate. In the case of memory accesse

[MLIR] Fix unchecked use of memref memory space attr in affine data copy generate (#116763)

Fix unchecked use of memref memory space attr in affine data copy
generate. In the case of memory accesses without a memory space
attribute or those other than integer attributes, the pass treats them
as slow memory spaces.

Fixes https://github.com/llvm/llvm-project/issues/116536

show more ...


# 4a0b8c3e 23-Nov-2024 Uday Bondhugula <uday@polymagelabs.com>

[MLIR][Affine] Drop assumptions of surrounding builtin.func op in Utils/LoopUtils (#116324)

Drop assumptions of surrounding builtin.func op in affine LoopUtils and
Utils. There are use cases of aff

[MLIR][Affine] Drop assumptions of surrounding builtin.func op in Utils/LoopUtils (#116324)

Drop assumptions of surrounding builtin.func op in affine LoopUtils and
Utils. There are use cases of affine fusion or affine transformation in
other func-like ops.
In the context of https://github.com/llvm/llvm-project/issues/116042

show more ...


# b3909f42 23-Nov-2024 Uday Bondhugula <uday@polymagelabs.com>

[MLIR] Drop assumption of a surrounding builtin.func in promoteIfSingleIteration (#116323)

Drop assumption of a surrounding builtin.func in
promoteIfSingleIteration.
Fixes https://github.com/llvm/

[MLIR] Drop assumption of a surrounding builtin.func in promoteIfSingleIteration (#116323)

Drop assumption of a surrounding builtin.func in
promoteIfSingleIteration.
Fixes https://github.com/llvm/llvm-project/issues/116042

show more ...


# 9e8200c7 21-Nov-2024 Krzysztof Drewniak <Krzysztof.Drewniak@amd.com>

[mlir][Affine] Expand affine.[de]linearize_index without affine maps (#116703)

As the documentation for -affine-expand-index-ops says,
affine.delinearize_index and affine.linearize_index don't need

[mlir][Affine] Expand affine.[de]linearize_index without affine maps (#116703)

As the documentation for -affine-expand-index-ops says,
affine.delinearize_index and affine.linearize_index don't need to be
expanded into the affine dialect.

Expanding these operations into affine.apply operations can introduce
unwanted "simplifications", mainly translations of `(dN mod C + ...)` to
`(dN + ... - (dN floordiv C) * C)` and similar, which create worse
generated code. This commit resolves this issue by expanding out
affine.delanierize_index directly.

In addition, the lowering of affine.linearize_index now sorts the
operands by loop-independence, allowing an increased amount of
loop-invariant code motion after lowering.

The old behavior is preserved as -expand-affine-index-ops-as-affine but
is no longer the default

show more ...


Revision tags: llvmorg-19.1.4
# d22d63a7 06-Nov-2024 Uday Bondhugula <uday@polymagelabs.com>

[MLIR][Affine] Fix signature of mlir::affine::permuteLoops (#111100)

The method doesn't mutate its argument. A mutable one was being passed
only to get around ArrayRef providing const on elements,

[MLIR][Affine] Fix signature of mlir::affine::permuteLoops (#111100)

The method doesn't mutate its argument. A mutable one was being passed
only to get around ArrayRef providing const on elements, which MLIR
doesn't use on IR types.

show more ...


Revision tags: llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1
# b52885bc 26-Sep-2024 Kazu Hirata <kazu@google.com>

[mlir] Use std::optional::value_or (NFC) (#109893)


Revision tags: llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2
# 5262865a 04-Aug-2024 Kazu Hirata <kazu@google.com>

[mlir] Construct SmallVector with ArrayRef (NFC) (#101896)


Revision tags: llvmorg-19.1.0-rc1, llvmorg-20-init
# ba8e4920 18-Jul-2024 Uday Bondhugula <uday@polymagelabs.com>

[MLIR] NFC. Remove anti-patterns given the default null init for Value (#99457)

Remove anti-patterns given the default null init for Value. Drop some
extra includes while on this file. NFC.

Co-a

[MLIR] NFC. Remove anti-patterns given the default null init for Value (#99457)

Remove anti-patterns given the default null init for Value. Drop some
extra includes while on this file. NFC.

Co-authored-by: GitHub runner <github-runner@polymagelabs.com>

show more ...


# cb8bd6f7 21-Jun-2024 Aviad Cohen <aviadcohen7@gmail.com>

Introduce new Unroll And Jam loop transform for SCF/Affine loops (#94142)

Unroll And Jam was supported in affine dialect long time ago using pass.
This commit exposes the pattern using transform an

Introduce new Unroll And Jam loop transform for SCF/Affine loops (#94142)

Unroll And Jam was supported in affine dialect long time ago using pass.
This commit exposes the pattern using transform and in addition adds
partial support for SCF loops.

show more ...


Revision tags: llvmorg-18.1.8
# 0fb216fb 11-Jun-2024 Ramkumar Ramachandra <ramkumar.ramachandra@codasip.com>

mlir/MathExtras: consolidate with llvm/MathExtras (#95087)

This patch is part of a project to move the Presburger library into
LLVM.


Revision tags: llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4
# 5aeb604c 04-Apr-2024 MaheshRavishankar <1663364+MaheshRavishankar@users.noreply.github.com>

[mlir][SCF] Modernize `coalesceLoops` method to handle `scf.for` loops with iter_args (#87019)

As part of this extension this change also does some general cleanup

1) Make all the methods take `R

[mlir][SCF] Modernize `coalesceLoops` method to handle `scf.for` loops with iter_args (#87019)

As part of this extension this change also does some general cleanup

1) Make all the methods take `RewriterBase` as arguments instead of
creating their own builders that tend to crash when used within
pattern rewrites
2) Split `coalesePerfectlyNestedLoops` into two separate methods, one
for `scf.for` and other for `affine.for`. The templatization didnt
seem to be buying much there.

Also general clean up of tests.

show more ...


Revision tags: llvmorg-18.1.3, llvmorg-18.1.2
# fab2bb8b 11-Mar-2024 Justin Lebar <justin.lebar@gmail.com>

Add llvm::min/max_element and use it in llvm/ and mlir/ directories. (#84678)

For some reason this was missing from STLExtras.


Revision tags: llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6
# d1e9c7b6 19-Nov-2023 max <maksim.levental@gmail.com>

Revert "[mlir][affine] implement `promoteIfSingleIteration` for `AffineForOp` (#72547)"

This reverts commit aa6be2f7c94ea3302fcc1ab034a85cd375eaa800.


# aa6be2f7 19-Nov-2023 Maksim Levental <maksim.levental@gmail.com>

[mlir][affine] implement `promoteIfSingleIteration` for `AffineForOp` (#72547)


Revision tags: llvmorg-17.0.5
# 1609f1c2 14-Nov-2023 long.chen <lipracer@gmail.com>

[mlir][affine][nfc] cleanup deprecated T.cast style functions (#71269)

detail see the docment: https://mlir.llvm.org/deprecation/

Not all changes are made manually, most of them are made through

[mlir][affine][nfc] cleanup deprecated T.cast style functions (#71269)

detail see the docment: https://mlir.llvm.org/deprecation/

Not all changes are made manually, most of them are made through a clang
tool I wrote https://github.com/lipracer/cpp-refactor.

show more ...


# d1ceb740 09-Nov-2023 Uday Bondhugula <uday@polymagelabs.com>

[MLIR][Affine] NFC. Fix stale comments and style in affine libraries (#71660)

Fix stale comments in affine libraries; fix clang-tidy warnings/style.
NFC.


Revision tags: llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2
# 23b794f7 29-Sep-2023 Matthias Springer <me@m-sp.org>

[mlir][Affine][NFC] Define AffineForOp operands in ODS (#67694)

Modernize affine dialect ops: Define LB, UB, step and inits as operands
in TableGen.


# 63086d6a 27-Sep-2023 Matthias Springer <me@m-sp.org>

[mlir][Interfaces] `LoopLikeOpInterface`: Add `replaceWithAdditionalYields` (#67121)

`affine::replaceForOpWithNewYields` and `replaceLoopWithNewYields` (for
"scf.for") are now interface methods and

[mlir][Interfaces] `LoopLikeOpInterface`: Add `replaceWithAdditionalYields` (#67121)

`affine::replaceForOpWithNewYields` and `replaceLoopWithNewYields` (for
"scf.for") are now interface methods and additional loop-carried
variables can now be added to "scf.for"/"affine.for" uniformly. (No more
`TypeSwitch` needed.)

Note: `scf.while` and other loops with loop-carried variables can
implement `replaceWithAdditionalYields`, but to keep this commit small,
that is not done in this commit.

show more ...


# 3bd7a9b4 21-Sep-2023 Matthias Springer <me@m-sp.org>

[mlir][Interfaces] `LoopLikeOpInterface`: Add helpers to get region iter_args and inits (#66925)

`AffineForOp::getInitOperands` is renamed to `getInits` to be consistent
with MLIR operand getter n

[mlir][Interfaces] `LoopLikeOpInterface`: Add helpers to get region iter_args and inits (#66925)

`AffineForOp::getInitOperands` is renamed to `getInits` to be consistent
with MLIR operand getter naming conventions. ("get" + operand name)

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, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4
# c40277f1 13-May-2023 Uday Bondhugula <uday@polymagelabs.com>

[MLIR] NFC. Pass affine copy options by const ref

NFC. Pass affine copy options by const ref.

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


# 5550c821 08-May-2023 Tres Popp <tpopp@google.com>

[mlir] Move casting calls from methods to function calls

The MLIR classes Type/Attribute/Operation/Op/Value support
cast/dyn_cast/isa/dyn_cast_or_null functionality through llvm's doCast
functionali

[mlir] Move casting calls from methods to function calls

The MLIR classes Type/Attribute/Operation/Op/Value support
cast/dyn_cast/isa/dyn_cast_or_null functionality through llvm's doCast
functionality in addition to defining methods with the same name.
This change begins the migration of uses of the method to the
corresponding function call as has been decided as more consistent.

Note that there still exist classes that only define methods directly,
such as AffineExpr, and this does not include work currently to support
a functional cast/isa call.

Caveats include:
- This clang-tidy script probably has more problems.
- This only touches C++ code, so nothing that is being generated.

Context:
- https://mlir.llvm.org/deprecation/ at "Use the free function variants
for dyn_cast/cast/isa/…"
- Original discussion at https://discourse.llvm.org/t/preferred-casting-style-going-forward/68443

Implementation:
This first patch was created with the following steps. The intention is
to only do automated changes at first, so I waste less time if it's
reverted, and so the first mass change is more clear as an example to
other teams that will need to follow similar steps.

Steps are described per line, as comments are removed by git:
0. Retrieve the change from the following to build clang-tidy with an
additional check:
https://github.com/llvm/llvm-project/compare/main...tpopp:llvm-project:tidy-cast-check
1. Build clang-tidy
2. Run clang-tidy over your entire codebase while disabling all checks
and enabling the one relevant one. Run on all header files also.
3. Delete .inc files that were also modified, so the next build rebuilds
them to a pure state.
4. Some changes have been deleted for the following reasons:
- Some files had a variable also named cast
- Some files had not included a header file that defines the cast
functions
- Some files are definitions of the classes that have the casting
methods, so the code still refers to the method instead of the
function without adding a prefix or removing the method declaration
at the same time.

```
ninja -C $BUILD_DIR clang-tidy

run-clang-tidy -clang-tidy-binary=$BUILD_DIR/bin/clang-tidy -checks='-*,misc-cast-functions'\
-header-filter=mlir/ mlir/* -fix

rm -rf $BUILD_DIR/tools/mlir/**/*.inc

git restore mlir/lib/IR mlir/lib/Dialect/DLTI/DLTI.cpp\
mlir/lib/Dialect/Complex/IR/ComplexDialect.cpp\
mlir/lib/**/IR/\
mlir/lib/Dialect/SparseTensor/Transforms/SparseVectorization.cpp\
mlir/lib/Dialect/Vector/Transforms/LowerVectorMultiReduction.cpp\
mlir/test/lib/Dialect/Test/TestTypes.cpp\
mlir/test/lib/Dialect/Transform/TestTransformDialectExtension.cpp\
mlir/test/lib/Dialect/Test/TestAttributes.cpp\
mlir/unittests/TableGen/EnumsGenTest.cpp\
mlir/test/python/lib/PythonTestCAPI.cpp\
mlir/include/mlir/IR/
```

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

show more ...


Revision tags: llvmorg-16.0.3
# 4c48f016 20-Apr-2023 Matthias Springer <springerm@google.com>

[mlir][Affine][NFC] Wrap dialect in "affine" namespace

This cleanup aligns the affine dialect with all the other dialects.

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


Revision tags: llvmorg-16.0.2
# 186c3d63 06-Apr-2023 Akshay Baviskar <akshay@polymagelabs.com>

[MLIR][Affine] Fix generateUnrolledLoop utility

generateUnrolledLoop was assuming that the yielded value is always generated in
the Block corresponding to the loop being unrolled. Thus, it was updat

[MLIR][Affine] Fix generateUnrolledLoop utility

generateUnrolledLoop was assuming that the yielded value is always generated in
the Block corresponding to the loop being unrolled. Thus, it was updating the
last yielded values with it's cloned value. However, if the yielded value is not
generated in the same Block then the cloned value and it's corresponding mapping
won't exist, resulting in a crash. Fix this.

Reviewed By: bondhugula

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

show more ...


123