| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[mlir] Fix MLIRTestDialect dependency in MLIRTestIR (#125705) This is a test library which is not part of libMLIR, so it should use normal LINK_LIBS instead of mlir_target_link_libraries. This fixes an issue introduced in #123910 and follows up on the fix in #125004, which added the library to DEPENDS, which is not sufficient. | 1 年前 | |
Switch member calls to isa/dyn_cast/cast/... to free function calls. (#89356) This change cleans up call sites. Next step is to mark the member functions deprecated. See https://mlir.llvm.org/deprecation and https://discourse.llvm.org/t/preferred-casting-style-going-forward. | 2 年前 | |
[MLIR] Apply clang-tidy fixes for performance-unnecessary-value-param in TestBuiltinAttributeInterfaces.cpp (NFC) | 10 个月前 | |
[mlir] Add a builtin distinct attribute A distinct attribute associates a referenced attribute with a unique identifier. Every call to its create function allocates a new distinct attribute instance. The address of the attribute instance temporarily serves as its unique identifier. Similar to the names of SSA values, the final unique identifiers are generated during pretty printing. Examples: #distinct = distinct[0]<42.0 : f32> #distinct1 = distinct[1]<42.0 : f32> #distinct2 = distinct[2]<array<i32: 10, 42>> This mechanism is meant to generate attributes with a unique identifier, which can be used to mark groups of operations that share a common properties such as if they are aliasing. The design of the distinct attribute ensures minimal memory footprint per distinct attribute since it only contains a reference to another attribute. All distinct attributes are stored outside of the storage uniquer in a thread local store that is part of the context. It uses one bump pointer allocator per thread to ensure distinct attributes can be created in-parallel. Reviewed By: rriddle, Dinistro, zero9178 Differential Revision: https://reviews.llvm.org/D153360 | 3 年前 | |
[mlir][test] Reorganize the test dialect (#89424) This PR massively reorganizes the Test dialect's source files. It moves manually-written op hooks into TestOpDefs.cpp, moves format custom directive parsers and printers into TestFormatUtils, adds missing comment blocks, and moves around where generated source files are included for types, attributes, enums, etc. into their own source file. This will hopefully help navigate the test dialect source code, but also speeds up compile time of the test dialect by putting generated source files into separate compilation units. This also sets up the test dialect to shard its op definitions, done in the next PR. | 2 年前 | |
[mlir][test] Reorganize the test dialect (#89424) This PR massively reorganizes the Test dialect's source files. It moves manually-written op hooks into TestOpDefs.cpp, moves format custom directive parsers and printers into TestFormatUtils, adds missing comment blocks, and moves around where generated source files are included for types, attributes, enums, etc. into their own source file. This will hopefully help navigate the test dialect source code, but also speeds up compile time of the test dialect by putting generated source files into separate compilation units. This also sets up the test dialect to shard its op definitions, done in the next PR. | 2 年前 | |
[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 | 3 年前 | |
[mlir] Add metadata to Diagnostic. (#99398) Add metadata to Diagnostic. Motivation: we have a use case where we want to do some filtering in our customized Diagnostic Handler based on some customized info that is not location or severity or diagnostic arguments that are member variables of Diagnostic. Specifically, we want to add a unique ID to the Diagnostic for the handler to filter in a compiler pass that emits errors in async tasks with multithreading and the diagnostic handling is associated to the task. This patch adds a field of metadata to mlir::Diagnostics as a general solution. metadata is of type SmallVector<DiagnosticArgument, 0> to save memory size and reuse existing DiagnosticArgument for metadata type. | 1 年前 | |
[mlir][IR] DominanceInfo: Fix inconsistency in proper block/op dominance (#115413) An operation is considered to properly dominate itself in a graph region. That's because there is no concept of "dominance" in a graph region. (dominates returns "true" for all pairs of ops in the same block. It makes sense to do the same for properlyDominates.) Previously, a block was *not* considered to dominate itself in a graph region. This commit fixes this asymmetry between ops and blocks: both are now properly dominating themselves in a graph region. | 1 年前 | |
[mlir] allow function type cloning to fail (#137130) FunctionOpInterface assumed the fact that the function type (attribute of the operation) can be cloned with arbirary lists of function arguments and results to support argument and result list mutation. This is not always correct, in particular, LLVM dialect functions require exactly one result making it impossible to erase the result. Allow function type cloning to fail and propagate this failure through various APIs that use it. The common assumption is that existing IR has not been modified. Fixes #131142. Reland a8c7ecdcbc3e89b493b495c6831cc93671c3b844 / #136300. | 1 年前 | |
[MLIR][ODS] Add support for overloading interface methods (#161828) This allows to define multiple interface methods with the same name but different arguments. | 9 个月前 | |
Add support for Lazyloading to the MLIR bytecode IsolatedRegions are emitted in sections in order for the reader to be able to skip over them. A new class is exposed to manage the state and allow the readers to load these IsolatedRegions on-demand. Differential Revision: https://reviews.llvm.org/D149515 | 3 年前 | |
[mlir] Move FunctionInterfaces to Interfaces directory and inherit from CallableOpInterface Functions are always callable operations and thus every operation implementing the FunctionOpInterface also implements the CallableOpInterface. The only exception was the FuncOp in the toy example. To make implementation of the FunctionOpInterface easier, this commit lets FunctionOpInterface inherit from CallableOpInterface and merges some of their methods. More precisely, the CallableOpInterface has methods to get the argument and result attributes and a method to get the result types of the callable region. These methods are always implemented the same way as their analogues in FunctionOpInterface and thus this commit moves all the argument and result attribute handling methods to the callable interface as well as the methods to get the argument and result types. The FuntionOpInterface then does not have to declare them as well, but just inherits them from the CallableOpInterface. Adding the inheritance relation also required to move the FunctionOpInterface from the IR directory to the Interfaces directory since IR should not depend on Interfaces. Reviewed By: jpienaar, springerm Differential Revision: https://reviews.llvm.org/D157988 | 2 年前 | |
[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 | 3 年前 | |
Cleanup uses of getAttrDictionary() in MLIR to use getDiscardableAttrDictionary() when possible This also speeds up some benchmarks in compiling simple fortan file by 2x! Fixes #62687 Differential Revision: https://reviews.llvm.org/D150540 | 3 年前 | |
[mlir][Value] Add getNumUses, hasNUses, and hasNUsesOrMore to Value (#142084) We already have hasOneUse. Like llvm::Value we provide helper methods to query the number of uses of a Value. Add unittests for Value, because that was missing. --------- Co-authored-by: Michael Maitland <michaelmaitland@meta.com> | 1 年前 | |
[mlir][NFC] update mlir/Dialect create APIs (28/n) (#150641) See https://github.com/llvm/llvm-project/pull/147168 for more info. | 1 年前 | |
[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] Fix Regions takeBody method if the region is not empty The current implementation of takeBody first clears the Region, before then taking ownership of the blocks of the other regions. The issue here however, is that when clearing the region, it does not take into account references of operations to each other. In particular, blocks are deleted from front to back, and operations within a block are very likely to be deleted despite still having uses, causing an assertion to trigger [0]. This patch fixes that issue by simply calling dropAllReferences()before clearing the blocks. [0] https://github.com/llvm/llvm-project/blob/9a8bb4bc635de9d56706262083c15eb1e0cf3e87/mlir/lib/IR/Operation.cpp#L154 Differential Revision: https://reviews.llvm.org/D123913 | 4 年前 | |
[mlir][vector] Fix attaching write effects on transfer_write's base (#142940) This fixes an issue with TransferWriteOp's implementation of the MemoryEffectOpInterface where the write effect was attached to the stored value rather than the base. This had the effect that when asking for the memory effects for the input memref buffer using getEffectsOnValue(...), the function would return no-effects (as the effect would have been attached to the stored value rather than the input buffer). | 1 年前 | |
[mlir][NFC] update mlir/Dialect create APIs (28/n) (#150641) See https://github.com/llvm/llvm-project/pull/147168 for more info. | 1 年前 | |
[mlir][test] Reorganize the test dialect (#89424) This PR massively reorganizes the Test dialect's source files. It moves manually-written op hooks into TestOpDefs.cpp, moves format custom directive parsers and printers into TestFormatUtils, adds missing comment blocks, and moves around where generated source files are included for types, attributes, enums, etc. into their own source file. This will hopefully help navigate the test dialect source code, but also speeds up compile time of the test dialect by putting generated source files into separate compilation units. This also sets up the test dialect to shard its op definitions, done in the next PR. | 2 年前 | |
[mlir][test] Reorganize the test dialect (#89424) This PR massively reorganizes the Test dialect's source files. It moves manually-written op hooks into TestOpDefs.cpp, moves format custom directive parsers and printers into TestFormatUtils, adds missing comment blocks, and moves around where generated source files are included for types, attributes, enums, etc. into their own source file. This will hopefully help navigate the test dialect source code, but also speeds up compile time of the test dialect by putting generated source files into separate compilation units. This also sets up the test dialect to shard its op definitions, done in the next PR. | 2 年前 | |
Fix memoery leak in MLIR use-def list ordering test | 3 年前 | |
Apply clang-tidy fixes for llvm-else-after-return in TestVisitors.cpp (NFC) | 2 年前 | |
[mlir][test] Reorganize the test dialect (#89424) This PR massively reorganizes the Test dialect's source files. It moves manually-written op hooks into TestOpDefs.cpp, moves format custom directive parsers and printers into TestFormatUtils, adds missing comment blocks, and moves around where generated source files are included for types, attributes, enums, etc. into their own source file. This will hopefully help navigate the test dialect source code, but also speeds up compile time of the test dialect by putting generated source files into separate compilation units. This also sets up the test dialect to shard its op definitions, done in the next PR. | 2 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 年前 | ||
| 2 年前 | ||
| 10 个月前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 9 个月前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 2 年前 |