|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, 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, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, 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, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, 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, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6 |
|
| #
6d5fc1e3 |
| 21-Jun-2022 |
Kazu Hirata <[email protected]> |
[mlir] Don't use Optional::getValue (NFC)
|
|
Revision tags: llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2 |
|
| #
58ceae95 |
| 18-Apr-2022 |
River Riddle <[email protected]> |
[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 |
|
| #
a70aa7bb |
| 21-Jan-2022 |
River Riddle <[email protected]> |
[mlir:Transforms] Move out the remaining non-dialect independent transforms and utilities
This has been a major TODO for a very long time, and is necessary for establishing a proper dialect-free dep
[mlir:Transforms] Move out the remaining non-dialect independent transforms and utilities
This has been a major TODO for a very long time, and is necessary for establishing a proper dialect-free dependency layering for the Transforms library. Code was moved to effectively two main locations:
* Affine/ There was quite a bit of affine dialect related code in Transforms/ do to historical reasons (of a time way into MLIR's past). The following headers were moved to: Transforms/LoopFusionUtils.h -> Dialect/Affine/LoopFusionUtils.h Transforms/LoopUtils.h -> Dialect/Affine/LoopUtils.h Transforms/Utils.h -> Dialect/Affine/Utils.h
The following transforms were also moved: AffineLoopFusion, AffinePipelineDataTransfer, LoopCoalescing
* SCF/ Only one SCF pass was in Transforms/ (likely accidentally placed here): ParallelLoopCollapsing The SCF specific utilities in LoopUtils have been moved to SCF/Utils.h
* Misc: mlir::moveLoopInvariantCode was also moved to LoopLikeInterface.h given that it is a simple utility defined in terms of LoopLikeOpInterface.
Differential Revision: https://reviews.llvm.org/D117848
show more ...
|
|
Revision tags: llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2 |
|
| #
41574554 |
| 04-Jan-2022 |
River Riddle <[email protected]> |
[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 ...
|
| #
755dc07d |
| 15-Jan-2022 |
River Riddle <[email protected]> |
[mlir:Analysis] Move the LoopAnalysis library to Dialect/Affine/Analysis
The current state of the top level Analysis/ directory is that it contains two libraries; a generic Analysis library (free fr
[mlir:Analysis] Move the LoopAnalysis library to Dialect/Affine/Analysis
The current state of the top level Analysis/ directory is that it contains two libraries; a generic Analysis library (free from dialect dependencies), and a LoopAnalysis library that contains various analysis utilities that originated from Affine loop transformations. This commit moves the LoopAnalysis to the more appropriate home of `Dialect/Affine/Analysis/`, given the use and intention of the majority of the code within it. After the move, if there are generic utilities that would fit better in the top-level Analysis/ directory, we can move them.
Differential Revision: https://reviews.llvm.org/D117351
show more ...
|
| #
9cf9ed94 |
| 27-Dec-2021 |
Uday Bondhugula <[email protected]> |
Multiple fixes to affine loop tiling return status and checks
Fix crash in the presence of yield values. Multiple fixes to affine loop tiling pre-condition checks and return status. Do not signal pa
Multiple fixes to affine loop tiling return status and checks
Fix crash in the presence of yield values. Multiple fixes to affine loop tiling pre-condition checks and return status. Do not signal pass failure on a failure to tile since the IR is still valid. Detect index set computation failure in checkIfHyperrectangular and return failure. Replace assertions with proper status return. Move checks to an appropriate place earlier in the utility before mutation happens.
Differential Revision: https://reviews.llvm.org/D116738
show more ...
|
| #
be0a7e9f |
| 07-Dec-2021 |
Mehdi Amini <[email protected]> |
Adjust "end namespace" comment in MLIR to match new agree'd coding style
See D115115 and this mailing list discussion: https://lists.llvm.org/pipermail/llvm-dev/2021-December/154199.html
Differenti
Adjust "end namespace" comment in MLIR to match new agree'd coding style
See D115115 and this mailing list discussion: https://lists.llvm.org/pipermail/llvm-dev/2021-December/154199.html
Differential Revision: https://reviews.llvm.org/D115309
show more ...
|
|
Revision tags: llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2 |
|
| #
e21adfa3 |
| 04-Feb-2021 |
River Riddle <[email protected]> |
[mlir] Mark LogicalResult as LLVM_NODISCARD
This makes ignoring a result explicit by the user, and helps to prevent accidental errors with dropped results. Marking LogicalResult as no discard was al
[mlir] Mark LogicalResult as LLVM_NODISCARD
This makes ignoring a result explicit by the user, and helps to prevent accidental errors with dropped results. Marking LogicalResult as no discard was always the intention from the beginning, but got lost along the way.
Differential Revision: https://reviews.llvm.org/D95841
show more ...
|
|
Revision tags: llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3 |
|
| #
0602e8f7 |
| 17-Sep-2020 |
Navdeep Kumar <[email protected]> |
[MLIR][Affine] Add parametric tile size support for affine.for tiling
Add support to tile affine.for ops with parametric sizes (i.e., SSA values). Currently supports hyper-rectangular loop nests wit
[MLIR][Affine] Add parametric tile size support for affine.for tiling
Add support to tile affine.for ops with parametric sizes (i.e., SSA values). Currently supports hyper-rectangular loop nests with constant lower bounds only. Move methods
- moveLoopBody(*) - getTileableBands(*) - checkTilingLegality(*) - tilePerfectlyNested(*) - constructTiledIndexSetHyperRect(*)
to allow reuse with constant tile size API. Add a test pass -test-affine -parametric-tile to test parametric tiling.
Differential Revision: https://reviews.llvm.org/D87353
show more ...
|
| #
430b47a1 |
| 04-Sep-2020 |
Uday Bondhugula <[email protected]> |
[MLIR] Remove unused arg from affine tiling validity check
Drop unused function arg from affine loop tiling validity check.
|
|
Revision tags: llvmorg-11.0.0-rc2 |
|
| #
654e8aad |
| 08-Aug-2020 |
Vincent Zhao <[email protected]> |
[MLIR] Consider AffineIfOp when getting the index set of an Op wrapped in nested loops
This diff attempts to resolve the TODO in `getOpIndexSet` (formerly known as `getInstIndexSet`), which states "
[MLIR] Consider AffineIfOp when getting the index set of an Op wrapped in nested loops
This diff attempts to resolve the TODO in `getOpIndexSet` (formerly known as `getInstIndexSet`), which states "Add support to handle IfInsts surronding `op`".
Major changes in this diff:
1. Overload `getIndexSet`. The overloaded version considers both `AffineForOp` and `AffineIfOp`. 2. The `getInstIndexSet` is updated accordingly: its name is changed to `getOpIndexSet` and its implementation is based on a new API `getIVs` instead of `getLoopIVs`. 3. Add `addAffineIfOpDomain` to `FlatAffineConstraints`, which extracts new constraints from the integer set of `AffineIfOp` and merges it to the current constraint system. 4. Update how a `Value` is determined as dim or symbol for `ValuePositionMap` in `buildDimAndSymbolPositionMaps`.
Differential Revision: https://reviews.llvm.org/D84698
show more ...
|
| #
754e09f9 |
| 06-Aug-2020 |
Vincent Zhao <[email protected]> |
[MLIR] Add tiling validity check to loop tiling pass
This revision aims to provide a new API, `checkTilingLegality`, to verify that the loop tiling result still satisifes the dependence constraints
[MLIR] Add tiling validity check to loop tiling pass
This revision aims to provide a new API, `checkTilingLegality`, to verify that the loop tiling result still satisifes the dependence constraints of the original loop nest.
Previously, there was no check for the validity of tiling. For instance:
``` func @diagonal_dependence() { %A = alloc() : memref<64x64xf32>
affine.for %i = 0 to 64 { affine.for %j = 0 to 64 { %0 = affine.load %A[%j, %i] : memref<64x64xf32> %1 = affine.load %A[%i, %j - 1] : memref<64x64xf32> %2 = addf %0, %1 : f32 affine.store %2, %A[%i, %j] : memref<64x64xf32> } }
return } ```
You can find more information about this example from the Section 3.11 of [1].
In general, there are three types of dependences here: two flow dependences, one in direction `(i, j) = (0, 1)` (notation that depicts a vector in the 2D iteration space), one in `(i, j) = (1, -1)`; and one anti dependence in the direction `(-1, 1)`.
Since two of them are along the diagonal in opposite directions, the default tiling method in `affine`, which tiles the iteration space into rectangles, will violate the legality condition proposed by Irigoin and Triolet [2]. [2] implies two tiles cannot depend on each other, while in the `affine` tiling case, two rectangles along the same diagonal are indeed dependent, which simply violates the rule.
This diff attempts to put together a validator that checks whether the rule from [2] is violated or not when applying the default tiling method in `affine`.
The canonical way to perform such validation is by examining the effect from adding the constraint from Irigoin and Triolet to the existing dependence constraints.
Since we already have the prior knowlegde that `affine` tiles in a hyper-rectangular way, and the resulting tiles will be scheduled in the same order as their respective loop indices, we can simplify the solution to just checking whether all dependence components are non-negative along the tiling dimensions.
We put this algorithm into a new API called `checkTilingLegality` under `LoopTiling.cpp`. This function iterates every `load`/`store` pair, and if there is any dependence between them, we get the dependence component and check whether it has any negative component. This function returns `failure` if the legality condition is violated.
[1]. Bondhugula, Uday. Effective Automatic parallelization and locality optimization using the Polyhedral model. https://dl.acm.org/doi/book/10.5555/1559029 [2]. Irigoin, F. and Triolet, R. Supernode Partitioning. https://dl.acm.org/doi/10.1145/73560.73588
Differential Revision: https://reviews.llvm.org/D84882
show more ...
|
|
Revision tags: llvmorg-11.0.0-rc1 |
|
| #
d135744c |
| 26-Jul-2020 |
Vincent Zhao <[email protected]> |
[MLIR][Affine] Add test for non-hyperrectangular loop tiling
This diff provides a concrete test case for the error that will be raised when the iteration space is non hyper-rectangular.
The corresp
[MLIR][Affine] Add test for non-hyperrectangular loop tiling
This diff provides a concrete test case for the error that will be raised when the iteration space is non hyper-rectangular.
The corresponding emission method for this error message has been changed as well.
Differential Revision: https://reviews.llvm.org/D84531
show more ...
|
|
Revision tags: llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4 |
|
| #
9db53a18 |
| 07-Jul-2020 |
River Riddle <[email protected]> |
[mlir][NFC] Remove usernames and google bug numbers from TODO comments.
These were largely leftover from when MLIR was a google project, and don't really follow LLVM guidelines.
|
|
Revision tags: llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2, llvmorg-10.0.1-rc1 |
|
| #
3dff8c91 |
| 20-Apr-2020 |
Uday Bondhugula <[email protected]> |
[MLIR] Fix affine loop tiling utility upper bound bug
Fix intra-tile upper bound setting in a scenario where the tile size was larger than the trip count.
Differential Revision: https://reviews.llv
[MLIR] Fix affine loop tiling utility upper bound bug
Fix intra-tile upper bound setting in a scenario where the tile size was larger than the trip count.
Differential Revision: https://reviews.llvm.org/D78505
show more ...
|
| #
ecddafd8 |
| 18-Apr-2020 |
Uday Bondhugula <[email protected]> |
[MLIR] NFC affine for op tiling cleanup / utility rename
Rename mlir::tileCodeGen -> mlir::tilePerfectlyNested to be consistent. NFC clean up tiling utility code, drop dead code, better comments. Ex
[MLIR] NFC affine for op tiling cleanup / utility rename
Rename mlir::tileCodeGen -> mlir::tilePerfectlyNested to be consistent. NFC clean up tiling utility code, drop dead code, better comments. Expose isPerfectlyNested and reuse.
Differential Revision: https://reviews.llvm.org/D78423
show more ...
|
| #
9f3ab92e |
| 15-Apr-2020 |
Jeremy Bruestle <[email protected]> |
[MLIR] Improve support for 0-dimensional Affine Maps.
Summary: Modified AffineMap::get to remove support for the overload which allowed an ArrayRef of AffineExpr but no context (and gathered the con
[MLIR] Improve support for 0-dimensional Affine Maps.
Summary: Modified AffineMap::get to remove support for the overload which allowed an ArrayRef of AffineExpr but no context (and gathered the context from a presumed first entry, resulting in bugs when there were 0 results).
Instead, we support only a ArrayRef and a context, and a version which takes a single AffineExpr.
Additionally, removed some now needless case logic which previously special cased which call to AffineMap::get to use.
Reviewers: flaub, bondhugula, rriddle!, nicolasvasilache, ftynse, ulysseB, mravishankar, antiagainst, aartbik
Subscribers: mehdi_amini, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, bader, grosul1, frgossen, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78226
show more ...
|
| #
400ad6f9 |
| 08-Apr-2020 |
River Riddle <[email protected]> |
[mlir] Eliminate the remaining usages of cl::opt instead of PassOption.
Summary: Pass options are a better choice for various reasons and avoid the need for static constructors.
Differential Revisi
[mlir] Eliminate the remaining usages of cl::opt instead of PassOption.
Summary: Pass options are a better choice for various reasons and avoid the need for static constructors.
Differential Revision: https://reviews.llvm.org/D77707
show more ...
|
| #
1834ad4a |
| 07-Apr-2020 |
River Riddle <[email protected]> |
[mlir][Pass] Update the PassGen to generate base classes instead of utilities
Summary: This is much cleaner, and fits the same structure as many other tablegen backends. This was not done originally
[mlir][Pass] Update the PassGen to generate base classes instead of utilities
Summary: This is much cleaner, and fits the same structure as many other tablegen backends. This was not done originally as the CRTP in the pass classes made it overly verbose/complex.
Differential Revision: https://reviews.llvm.org/D77367
show more ...
|
| #
80aca1ea |
| 07-Apr-2020 |
River Riddle <[email protected]> |
[mlir][Pass] Remove the use of CRTP from the Pass classes
This revision removes all of the CRTP from the pass hierarchy in preparation for using the tablegen backend instead. This creates a much cle
[mlir][Pass] Remove the use of CRTP from the Pass classes
This revision removes all of the CRTP from the pass hierarchy in preparation for using the tablegen backend instead. This creates a much cleaner interface in the C++ code, and naturally fits with the rest of the infrastructure. A new utility class, PassWrapper, is added to replicate the existing behavior for passes not suitable for using the tablegen backend.
Differential Revision: https://reviews.llvm.org/D77350
show more ...
|
| #
9a277af2 |
| 01-Apr-2020 |
River Riddle <[email protected]> |
[mlir][Pass] Add support for generating pass utilities via tablegen
This revision adds support for generating utilities for passes such as options/statistics/etc. that can be inferred from the table
[mlir][Pass] Add support for generating pass utilities via tablegen
This revision adds support for generating utilities for passes such as options/statistics/etc. that can be inferred from the tablegen definition. This removes additional boilerplate from the pass, and also makes it easier to remove the reliance on the pass registry to provide certain things(e.g. the pass argument).
Differential Revision: https://reviews.llvm.org/D76659
show more ...
|
| #
e3d834a5 |
| 01-Apr-2020 |
River Riddle <[email protected]> |
[mlir][Pass] Move the registration of dialect passes to tablegen
This generates a Passes.td for all of the dialects that have transformation passes. This removes the need for global registration for
[mlir][Pass] Move the registration of dialect passes to tablegen
This generates a Passes.td for all of the dialects that have transformation passes. This removes the need for global registration for all of the dialect passes.
Differential Revision: https://reviews.llvm.org/D76657
show more ...
|
|
Revision tags: llvmorg-10.0.0, llvmorg-10.0.0-rc6 |
|
| #
43a95a54 |
| 23-Mar-2020 |
Uday Bondhugula <[email protected]> |
[MLIR] Introduce full/partial tile separation using if/else
This patch introduces a utility to separate full tiles from partial tiles when tiling affine loop nests where trip counts are unknown or w
[MLIR] Introduce full/partial tile separation using if/else
This patch introduces a utility to separate full tiles from partial tiles when tiling affine loop nests where trip counts are unknown or where tile sizes don't divide trip counts. A conditional guard is generated to separate out the full tile (with constant trip count loops) into the then block of an 'affine.if' and the partial tile to the else block. The separation allows the 'then' block (which has constant trip count loops) to be optimized better subsequently: for eg. for unroll-and-jam, register tiling, vectorization without leading to cleanup code, or to offload to accelerators. Among techniques from the literature, the if/else based separation leads to the most compact cleanup code for multi-dimensional cases (because a single version is used to model all partial tiles).
INPUT
affine.for %i0 = 0 to %M { affine.for %i1 = 0 to %N { "foo"() : () -> () } }
OUTPUT AFTER TILING W/O SEPARATION
map0 = affine_map<(d0) -> (d0)> map1 = affine_map<(d0)[s0] -> (d0 + 32, s0)>
affine.for %arg2 = 0 to %M step 32 { affine.for %arg3 = 0 to %N step 32 { affine.for %arg4 = #map0(%arg2) to min #map1(%arg2)[%M] { affine.for %arg5 = #map0(%arg3) to min #map1(%arg3)[%N] { "foo"() : () -> () } } } }
OUTPUT AFTER TILING WITH SEPARATION
map0 = affine_map<(d0) -> (d0)> map1 = affine_map<(d0) -> (d0 + 32)> map2 = affine_map<(d0)[s0] -> (d0 + 32, s0)>
#set0 = affine_set<(d0, d1)[s0, s1] : (-d0 + s0 - 32 >= 0, -d1 + s1 - 32 >= 0)>
affine.for %arg2 = 0 to %M step 32 { affine.for %arg3 = 0 to %N step 32 { affine.if #set0(%arg2, %arg3)[%M, %N] { // Full tile. affine.for %arg4 = #map0(%arg2) to #map1(%arg2) { affine.for %arg5 = #map0(%arg3) to #map1(%arg3) { "foo"() : () -> () } } } else { // Partial tile. affine.for %arg4 = #map0(%arg2) to min #map2(%arg2)[%M] { affine.for %arg5 = #map0(%arg3) to min #map2(%arg3)[%N] { "foo"() : () -> () } } } } }
The separation is tested via a cmd line flag on the loop tiling pass. The utility itself allows one to pass in any band of contiguously nested loops, and can be used by other transforms/utilities. The current implementation works for hyperrectangular loop nests.
Signed-off-by: Uday Bondhugula <[email protected]>
Differential Revision: https://reviews.llvm.org/D76700
show more ...
|
| #
78e61496 |
| 23-Mar-2020 |
Uday Bondhugula <[email protected]> |
[MLIR][NFC] loop tiling - improve comments / naming
Improve comments, naming, and other cleanup
Signed-off-by: Uday Bondhugula <[email protected]>
Differential Revision: https://reviews.llvm.o
[MLIR][NFC] loop tiling - improve comments / naming
Improve comments, naming, and other cleanup
Signed-off-by: Uday Bondhugula <[email protected]>
Differential Revision: https://reviews.llvm.org/D76616
show more ...
|
| #
b8737614 |
| 22-Mar-2020 |
Uday Bondhugula <[email protected]> |
[MLIR][NFC] Move some of the affine transforms / tests to dialect dirs
Move some of the affine transforms and their test cases to their respective dialect directory. This patch does not complete the
[MLIR][NFC] Move some of the affine transforms / tests to dialect dirs
Move some of the affine transforms and their test cases to their respective dialect directory. This patch does not complete the move, but takes care of a good part.
Renames: prefix 'affine' to affine loop tiling cl options, vectorize -> super-vectorize
Signed-off-by: Uday Bondhugula <[email protected]>
Differential Revision: https://reviews.llvm.org/D76565
show more ...
|