RRiver Riddle[mlir] Refactor SubElementInterface replace support
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[mlir] Use value instead of getValue (NFC) | 3 年前 | |
[mlir] (NFC) Clean up bazel and CMake target names All dialect targets in bazel have been named *Dialect and all dialect targets in CMake have been named MLIR*Dialect. | 3 年前 | |
[mlir] Refactor SubElementInterface replace support The current support was essentially the amount necessary to support replacing SymbolRefAttrs, but suffers from various deficiencies (both ergonomic and functional): * Replace crashes if unsupported This makes it really hard to use safely, given that you don't know if you are going to crash or not when using it. * Types aren't supported This seems like a simple missed addition when the attribute replacement support was originally added. * The ergonomics are weird It currently uses an index based replacement, which makes the implementations quite clunky. This commit refactors support to be a bit more ergonomic, and also adds support for types in the process. This was also a great oppurtunity to greatly simplify how replacement is done in the symbol table. Fixes #56355 Differential Revision: https://reviews.llvm.org/D130589 | 3 年前 | |
[mlir] remove unnecessary statements in test A previous commit (f2b94bd) added some unnecessary statements that dereferenced operations only to get the operations back. This patch removes the unnecessary statements. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D129913 | 3 年前 | |
[mlir][Linalg] Deprecate tileAndFuseLinalgOps method and associated patterns. The tileAndFuseLinalgOps is a legacy approach for tiling + fusion of Linalg operations. Since it was also intended to work on operations with buffer operands, this method had fairly complex logic to make sure tile and fuse was correct even with side-effecting linalg ops. While complex, it still wasnt robust enough. This patch deprecates this method and thereby deprecating the tiling + fusion method for ops with buffer semantics. Note that the core transformation to do fusion of a producer with a tiled consumer still exists. The deprecation here only removes methods that auto-magically tried to tile and fuse correctly in presence of side-effects. The tileAndFuseLinalgOps also works with operations with tensor semantics. There are at least two other ways the same functionality exists. 1) The tileConsumerAndFuseProducers method. This does a similar transformation, but using a slightly different logic to automatically figure out the legal tile + fuse code. Note that this is also to be deprecated soon. 2) The prefered way uses the TilingInterface for tile + fuse, and relies on the caller to set the tiling options correctly to ensure that the generated code is correct. As proof that (2) is equivalent to the functionality provided by tileAndFuseLinalgOps, relevant tests have been moved to use the interface, where the test driver sets the tile sizes appropriately to generate the expected code. Differential Revision: https://reviews.llvm.org/D129901 | 3 年前 | |
[mlir] Fixed ordering of pass statistics. The change makes sure the plain C string statistics names are properly ordered. Differential Revision: https://reviews.llvm.org/D130122 | 3 年前 | |
[mlir] Rework the implementation of TypeID This commit restructures how TypeID is implemented to ideally avoid the current problems related to shared libraries. This is done by changing the "implicit" fallback path to use the name of the type, instead of using a static template variable (which breaks shared libraries). The major downside to this is that it adds some additional initialization costs for the implicit path. Given the use of type names for uniqueness in the fallback, we also no longer allow types defined in anonymous namespaces to have an implicit TypeID. To simplify defining an ID for these classes, a new MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID macro was added to allow for explicitly defining a TypeID directly on an internal class. To help identify when types are using the fallback, -debug-only=typeid can be used to log which types are using implicit ids. This change generally only requires changes to the test passes, which are all defined in anonymous namespaces, and thus can't use the fallback any longer. Differential Revision: https://reviews.llvm.org/D122775 | 4 年前 | |
[mlir:PDL] Expand how native constraint/rewrite functions can be defined This commit refactors the expected form of native constraint and rewrite functions, and greatly reduces the necessary user complexity required when defining a native function. Namely, this commit adds in automatic processing of the necessary PDLValue glue code, and allows for users to define constraint/rewrite functions using the C++ types that they actually want to use. As an example, lets see a simple example rewrite defined today: static void rewriteFn(PatternRewriter &rewriter, PDLResultList &results, ArrayRef<PDLValue> args) { ValueRange operandValues = args[0].cast<ValueRange>(); TypeRange typeValues = args[1].cast<TypeRange>(); ... // Create an operation at some point and pass it back to PDL. Operation *op = rewriter.create<SomeOp>(...); results.push_back(op); } After this commit, that same rewrite could be defined as: static Operation *rewriteFn(PatternRewriter &rewriter ValueRange operandValues, TypeRange typeValues) { ... // Create an operation at some point and pass it back to PDL. return rewriter.create<SomeOp>(...); } Differential Revision: https://reviews.llvm.org/D122086 | 4 年前 | |
[mlir] Use context provided rather than getContext Avoids "pass state was never initialized" assertion failure. | 4 年前 | |
[mlir] Use has_value instead of hasValue (NFC) | 3 年前 | |
[mlir][TilingInterface] Add pattern to tile using TilingInterface and implement TilingInterface for Linalg ops. This patch adds support for tiling operations that implement the TilingInterface. - 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 | 3 年前 |