Use llvm::sort instead of std::sort where possiblellvm::sort is beneficial even when we use the iterator-based overload,since it can optionally shuffle the elements (to detectnon-determinism). Ho
Use llvm::sort instead of std::sort where possiblellvm::sort is beneficial even when we use the iterator-based overload,since it can optionally shuffle the elements (to detectnon-determinism). However llvm::sort is not usable everywhere, forexample, in compiler-rt.Reviewed By: nhaehnleDifferential Revision: https://reviews.llvm.org/D130406
show more ...
[mlir] Use has_value instead of hasValue (NFC)
[MLIR][Presburger] Rename variable/identifier -> variableCurrently, in the Presburger library, we use the words "variables" and"identifiers" interchangeably. This patch changes this to only use "v
[MLIR][Presburger] Rename variable/identifier -> variableCurrently, in the Presburger library, we use the words "variables" and"identifiers" interchangeably. This patch changes this to only use "variables" torefer to the variables of PresburgerSpace.The reasoning behind this change is that the current usage of the word "identifier"is misleading. variables do not "identify" anything. The information attached to them is theactual "identifier" for the variable. The word "identifier", will later be usedto refer to the information attached to each variable in space.Reviewed By: ftynseDifferential Revision: https://reviews.llvm.org/D128585
Revert "Don't use Optional::hasValue (NFC)"This reverts commit aa8feeefd3ac6c78ee8f67bf033976fc7d68bc6d.
Don't use Optional::hasValue (NFC)
[mlir][SCF] Add scf::ForeachThread canonicalization.This revision adds the necessary plumbing for canonicalizing scf::ForeachThread with the`AffineOpSCFCanonicalizationPattern`.In the process the
[mlir][SCF] Add scf::ForeachThread canonicalization.This revision adds the necessary plumbing for canonicalizing scf::ForeachThread with the`AffineOpSCFCanonicalizationPattern`.In the process the `loopMatcher` helper is updated to take OpFoldResult instead of just values.This allows composing various scenarios without the need for an artificial builder.Differential Revision: https://reviews.llvm.org/D128244
[mlir] move SCF headers to SCF/{IR,Transforms} respectivelyThis aligns the SCF dialect file layout with the majority of the dialects.Reviewed By: jpienaarDifferential Revision: https://reviews.
[mlir] move SCF headers to SCF/{IR,Transforms} respectivelyThis aligns the SCF dialect file layout with the majority of the dialects.Reviewed By: jpienaarDifferential Revision: https://reviews.llvm.org/D128049
[mlir][TilingInterface] Add pattern to tile using TilingInterface and implement TilingInterface for Linalg ops.This patch adds support for tiling operations that implement theTilingInterface.- It
[mlir][TilingInterface] Add pattern to tile using TilingInterface and implement TilingInterface for Linalg ops.This patch adds support for tiling operations that implement theTilingInterface.- It separates the loop constructs that are used to iterate over tile from the implementation of the tiling itself. For example, the use of destructive updates is more related to use of scf.for for iterating over tiles that are tensors.- To test the transformation, TilingInterface is implemented for LinalgOps. The separation of the looping constructs used from the implementation of tile code generation greatly simplifies the latter.- The implementation of TilingInterface for LinalgOp is kept as an external model for now till this approach can be fully flushed out to replace the existing tiling + fusion approaches in Linalg.Differential Revision: https://reviews.llvm.org/D127133
[mlir] (NFC) Clean up bazel and CMake target namesAll dialect targets in bazel have been named *Dialect and all dialecttargets in CMake have been named MLIR*Dialect.
[mlir] Introduce Transform ops for loopsIntroduce transform ops for "for" loops, in particular for peeling, softwarepipelining and unrolling, along with a couple of "IR navigation" ops. These ops
[mlir] Introduce Transform ops for loopsIntroduce transform ops for "for" loops, in particular for peeling, softwarepipelining and unrolling, along with a couple of "IR navigation" ops. These opsare intended to be generalized to different kinds of loops when possible andtherefore use the "loop" prefix. They currently live in the SCF dialect asthere is no clear place to put transform ops that may span across severaldialects, this decision is postponed until the ops actually need to handlenon-SCF loops.Additionally refactor some common utilities for transform ops into trait orinterface methods, and change the loop pipelining to be a returning pattern.Reviewed By: springermDifferential Revision: https://reviews.llvm.org/D127300
[mlir][NFC] Replace some llvm::find with llvm::is_contained.This patch replaces some llvm::find with llvm::is_contained, it should be more clear.Differential Revision: https://reviews.llvm.org/D1
[mlir][NFC] Replace some llvm::find with llvm::is_contained.This patch replaces some llvm::find with llvm::is_contained, it should be more clear.Differential Revision: https://reviews.llvm.org/D127077
Apply clang-tidy fixes for performance-unnecessary-value-param in Utils.cpp (NFC)
[MLIR][Presburger] Cleanup getMaybeValues in FACVThis patch cleans up multiple getMaybeValue functions to take an IdKind insteadof special functions.Reviewed By: arjunpDifferential Revision: h
[MLIR][Presburger] Cleanup getMaybeValues in FACVThis patch cleans up multiple getMaybeValue functions to take an IdKind insteadof special functions.Reviewed By: arjunpDifferential Revision: https://reviews.llvm.org/D125617
[mlir] Fix loop unrolling: properly replace the arguments of the epilogue loop.Using "replaceUsesOfWith" is incorrect because the same initializer value may appear multiple times.For example, if
[mlir] Fix loop unrolling: properly replace the arguments of the epilogue loop.Using "replaceUsesOfWith" is incorrect because the same initializer value may appear multiple times.For example, if the epilogue is needed when this loop is unrolled```%x:2 = scf.for ... iter_args(%arg1 = %c1, %arg2 = %c1) { ...}```then both epilogue's arguments will be incorrectly renamed to use the same result index (note #1 in both cases):```%x_unrolled:2 = scf.for ... iter_args(%arg1 = %c1, %arg2 = %c1) { ...}%x_epilogue:2 = scf.for ... iter_args(%arg1 = %x_unrolled#1, %arg2 = %x_unrolled#1) { ...}```
[mlir][SCF] Retire `cloneWithNewYields` helper function.This is now subsumed by `replaceLoopWithNewYields`.Differential Revision: https://reviews.llvm.org/D125309
[mlir][SCF] Add utility method to add new yield values to a loop.The current implementation of `cloneWithNewYields` has a few issues- It clones the loop body of the original loop to create a new
[mlir][SCF] Add utility method to add new yield values to a loop.The current implementation of `cloneWithNewYields` has a few issues- It clones the loop body of the original loop to create a new loop. This is very expensive.- It performs `erase` operations which are incompatible when this method is called from within a pattern rewrite. All erases need to go through `PatternRewriter`.To address these a new utility method `replaceLoopWithNewYields` is addedwhich- moves the operations from the original loop into the new loop.- replaces all uses of the original loop with the corresponding results of the new loop- use a call back to allow caller to generate the new yield values.- the original loop is modified to just yield the basic block arguments corresponding to the iter_args of the loop. This represents a no-op loop. The loop itself is dead (since all its uses are replaced), but is not removed. The caller is expected to erase the op. Consequently, this method can be called from within a `matchAndRewrite` method of a `PatternRewriter`.The `cloneWithNewYields` could be replaces with`replaceLoopWithNewYields`, but that seems to trigger a failure duringwalks, potentially due to the operations being moved. That is left asa TODO.Differential Revision: https://reviews.llvm.org/D125147
[mlir:NFC] Remove the forward declaration of FuncOp in the mlir namespaceFuncOp has been moved to the `func` namespace for a little over a month, theusing directive can be dropped now.
[MLIR][Affine][Analysis] Merge FAC and FACVWith the introduction of IntegerPolyhedron and IntegerRelation in Presburgerdirectory, the purpose of FlatAffineConstraints becomes redundant. For users
[MLIR][Affine][Analysis] Merge FAC and FACVWith the introduction of IntegerPolyhedron and IntegerRelation in Presburgerdirectory, the purpose of FlatAffineConstraints becomes redundant. For usersrequiring Presburger arithmetic without IR information, Presburger library candirectly be used. For users requiring IR information,FlatAffineValueConstraints can be used.This patch merges FAC and FACV to remove redundancy of FAC.Reviewed By: arjunpDifferential Revision: https://reviews.llvm.org/D122476
[mlir] Rename the Standard dialect to the Func dialectThe last remaining operations in the standard dialect all revolve aroundFuncOp/function related constructs. This patch simply handles the init
[mlir] Rename the Standard dialect to the Func dialectThe last remaining operations in the standard dialect all revolve aroundFuncOp/function related constructs. This patch simply handles the initialrenaming (which by itself is already huge), but there are a large numberof cleanups unlocked/necessary afterwards:* Removing a bunch of unnecessary dependencies on Func* Cleaning up the From/ToStandard conversion passes* Preparing for the move of FuncOp to the Func dialectSee the discussion at https://discourse.llvm.org/t/standard-dialect-the-final-chapter/6061Differential Revision: https://reviews.llvm.org/D120624
[mlir][SCF] Further simplify affine maps during `for-loop-canonicalization`* Implement `FlatAffineConstraints::getConstantBound(EQ)`.* Inject a simpler constraint for loops that have at most 1 ite
[mlir][SCF] Further simplify affine maps during `for-loop-canonicalization`* Implement `FlatAffineConstraints::getConstantBound(EQ)`.* Inject a simpler constraint for loops that have at most 1 iteration.* Taking into account constant EQ bounds of FlatAffineConstraint dims/symbols during canonicalization of the resulting affine map in `canonicalizeMinMaxOp`.Differential Revision: https://reviews.llvm.org/D119153
[mlir] Move SelectOp from Standard to ArithmeticThis is part of splitting up the standard dialect. See https://llvm.discourse.group/t/standard-dialect-the-final-chapter/ for discussion.Differenti
[mlir] Move SelectOp from Standard to ArithmeticThis is part of splitting up the standard dialect. See https://llvm.discourse.group/t/standard-dialect-the-final-chapter/ for discussion.Differential Revision: https://reviews.llvm.org/D118648
[mlir] Move SCF utils implementations to SCF/Utils.BEGIN_PUBLIC[mlir] Move SCF utils implementations to SCF/Utils.END_PUBLIC