| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Fix MLIR build failure: error: no member named 'getValue' in 'mlir::OptionalParseResult' Fix #63072 | 2 年前 | |
[mlir] Move tblgen code generation to use functional forms of cast/isa Summary: The method forms are deprecated. This updates the rest of the tblgen uses of methods where a function call is available. 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 Reviewers: rriddle | 3 年前 | |
[mlir][ods] Make Attr/Type def accessors match the dialect The generated attribute and type def accessors are changed to match the setting on the dialect. Most importantly, "prefixed" will now correctly convert snake case to camel case (e.g. weight_zp -> getWeightZp) Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D127688 | 4 年前 | |
[mlir][bytecodegen] Don't emit empty case (NFC) | 3 年前 | |
Convert MLIR IndentedOstream to header only. This class has been causing me no end of grief for a long time, and the way it is used by mlir-tblgen is technically an ODR violation in certain situations. Due to the way that the build is layered, it is important that the MLIR tablegen libraries only depend on the LLVM tablegen libraries, not on anything else (like MLIRSupport). It has to be this way because these libraries/binaries are special and must pre-exist the full shared libraries. Therefore, the dependency chain must be clean (and static). At some point, someone pulled out a separate build target for just IndendedOstream in an attempt to satisfy the constraint. But because it is weird in different ways, this target was never installed properly as part of distributions, etc -- this causes problems for downstreams seeking to build a tblggen binary that doesn't itself have ODR/shared library problems. I was attempting to fix the distribution stuff but just opted to collapse this into a header-only library and not try to solve this with build layering. I think this is the safest and the least bad thing for such a dep. This also makes for a clean comment that actually explains the constraint (which I was having trouble verbalizing with the weird subset dependency). Differential Revision: https://reviews.llvm.org/D153393 | 3 年前 | |
mlir/tblgen: use std::optional in generation This is part of an effort to migrate from llvm::Optional to std::optional. This patch changes the way mlir-tblgen generates .inc files, and modifies tests and documentation appropriately. It is a "no compromises" patch, and doesn't leave the user with an unpleasant mix of llvm::Optional and std::optional. A non-trivial change has been made to ControlFlowInterfaces to split one constructor into two, relating to a build failure on Windows. See also: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716 Signed-off-by: Ramkumar Ramachandra <r@artagnon.com> Differential Revision: https://reviews.llvm.org/D138934 | 3 年前 | |
[TableGen] llvm::Optional => std::optional | 3 年前 | |
[mlir][ods] Remove StrEnumAttr StrEnumAttr has been deprecated in favour of EnumAttr, a solution based on AttrDef (https://reviews.llvm.org/D115181). This patch removes StrEnumAttr, along with all the custom ODS logic required to handle it. See https://discourse.llvm.org/t/psa-stop-using-strenumattr-do-use-enumattr/5710 on how to transition to EnumAttr. In short, // Before def MyEnumAttr : StrEnumAttr<"MyEnum", "", [ StrEnumAttrCase<"A">, StrEnumAttrCase<"B"> ]>; // After (pick an integer enum of your choice) def MyEnum : I32EnumAttr<"MyEnum", "", [ I32EnumAttrCase<"A", 0>, I32EnumAttrCase<"B", 1> ]> { // Don't generate a C++ class! We want to use the AttrDef let genSpecializedAttr = 0; } // Define the AttrDef def MyEnum : EnumAttr<MyDialect, MyEnum, "my_enum">; Reviewed By: rriddle, jpienaar Differential Revision: https://reviews.llvm.org/D120834 | 4 年前 | |
[MLIR][Doc] Also print summarys for passes on a newline This patch is improves upon https://reviews.llvm.org/D152621. There, I pointed out some issues with D152621, which I'll repeat here. > Passes use a different logic for generating the documentation; which I didn't update to be in-line with this change. Fixed by defining and using mlir::tblgen::emitSummary. This is now used in OpDocGen.cpp and PassDocGen.cpp. Note that the passes documentation currently prints the summary behind the pass argument. For example: #### -arm-neon-2d-to-intr: Convert Arm NEON structured ops to intrinsics at https://mlir.llvm.org/docs/Passes/#-promote-buffers-to-stack-promotes-heap-based-allocations-to-automatically-managed-stack-based-allocations. This currently differs from how the summary is printed for Ops. For example: #### amdgpu.lds_barrier (::mlir::amdgpu::LDSBarrierOp) ¶ **Summary:** _Barrier that includes a wait for LDS memory operations._ at https://mlir.llvm.org/docs/Dialects/AMDGPU/#amdgpulds_barrier-mliramdgpuldsbarrierop. The changes in this patch ensure that: 1. The summary is always printed on a new line. 2. The summary is always printed in italic. 3. The summary always starts with a capital letter. I've dropped the **Summary:**, which was introduced in D152621, because only italicization should be already clear enough. > amx.tdpbssd shows **Summary:** __ meaning that apparently hasSummary does not guarantee a non-empty summary. This is fixed by double-checking !summary.empty(), because the following code cpp void mlir::tblgen::emitSummary(StringRef summary, raw_ostream &os) { if (!summary.empty()) { char first = std::toupper(summary.front()); llvm::StringRef rest = summary.drop_front(); os << "\n_" << first << rest << "_\n\n"; } else { os << "\n_" << "foo" << "_\n\n"; } } generates the following Markdown: `` ### amx.tdpbssd (::mlir::amx::x86_amx_tdpbssd) _foo_ ` in tools/mlir/docs/Dialects/AMX.md`. > Summary fields containing * cancel the italicization, so the * should probably be escaped to solve this. EDIT: Nope. This is because mlir-www runs Hugo 0.80 whereas 0.111 correctly parses _Raw Buffer Floating-point Atomic Add (MI-* only)_ as an italicized string. This will be fixed by https://github.com/llvm/mlir-www/pull/152. Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D152648 | 3 年前 | |
[mlir] Move tblgen code generation to use functional forms of cast/isa Summary: The method forms are deprecated. This updates the rest of the tblgen uses of methods where a function call is available. 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 Reviewers: rriddle | 3 年前 | |
Introduce MLIR Op Properties This new features enabled to dedicate custom storage inline within operations. This storage can be used as an alternative to attributes to store data that is specific to an operation. Attribute can also be stored inside the properties storage if desired, but any kind of data can be present as well. This offers a way to store and mutate data without uniquing in the Context like Attribute. See the OpPropertiesTest.cpp for an example where a struct with a std::vector<> is attached to an operation and mutated in-place: struct TestProperties { int a = -1; float b = -1.; std::vector<int64_t> array = {-33}; }; More complex scheme (including reference-counting) are also possible. The only constraint to enable storing a C++ object as "properties" on an operation is to implement three functions: - convert from the candidate object to an Attribute - convert from the Attribute to the candidate object - hash the object Optional the parsing and printing can also be customized with 2 extra functions. A new options is introduced to ODS to allow dialects to specify: let usePropertiesForAttributes = 1; When set to true, the inherent attributes for all the ops in this dialect will be using properties instead of being stored alongside discardable attributes. The TestDialect showcases this feature. Another change is that we introduce new APIs on the Operation class to access separately the inherent attributes from the discardable ones. We envision deprecating and removing the getAttr(), getAttrsDictionary(), and other similar method which don't make the distinction explicit, leading to an entirely separate namespace for discardable attributes. Recommit d572cd1b067f after fixing python bindings build. Differential Revision: https://reviews.llvm.org/D141742 | 3 年前 | |
[mlir][ODS] Add support for passing properties to custom Printing and parsing properties of ops is currently only possible through the prop-dict attribute. This forces a specific place that the property is printed at and is generally not very flexible. This patch adds support for passing properties to the custom directive, making it possible to incorporate them with more complex syntax. This makes it possible to parse and print them without generic syntax and without the use of prop-dict. Differential Revision: https://reviews.llvm.org/D155072 | 2 年前 | |
[mlir][llvm] Add debug label intrinsic This revision adds support for the llvm.dbg.label.intrinsic and the corresponding DILabel metadata. Reviewed By: Dinistro Differential Revision: https://reviews.llvm.org/D153975 | 2 年前 | |
[mlir][flang] Convert TBAA metadata to an attribute representation The current representation of TBAA is the very last in-tree user of the llvm.metadata operation. Using ops to model metadata has a few disadvantages: * Building a graph has to be done through some weakly typed indirection mechanism such as SymbolRefAttr * Creating the metadata has to be done through a builder within a metadata op. * It is not multithreading safe as operation insertion into the same block is not thread-safe This patch therefore converts TBAA metadata into an attribute representation, in a similar manner as it has been done for alias groups and access groups in previous patches. This additionally has the large benefit of giving us more "correctness by construction" as it makes things like cycles in a TBAA graph, or references to an incorrectly typed metadata node impossible. Differential Revision: https://reviews.llvm.org/D155444 | 2 年前 | |
[ODS] Extra Concrete Declarations and Definitions under Traits Support extra concrete class declarations and definitions under NativeTrait that get injected into the class that specifies the trait. Extra declarations and definitions can be passed in as template arguments for NativeOpTraitNativeAttrTrait and NativeTypeTrait. Usage examples of this feature include: - Creating a wrapper Trait for authoring inferReturnTypes with the OpAdaptor by specifying necessary Op specific declarations and definitions directly in the trait - Refactoring the InferTensorType trait Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D154731 | 2 年前 | |
[ODS] Extra Concrete Declarations and Definitions under Traits Support extra concrete class declarations and definitions under NativeTrait that get injected into the class that specifies the trait. Extra declarations and definitions can be passed in as template arguments for NativeOpTraitNativeAttrTrait and NativeTypeTrait. Usage examples of this feature include: - Creating a wrapper Trait for authoring inferReturnTypes with the OpAdaptor by specifying necessary Op specific declarations and definitions directly in the trait - Refactoring the InferTensorType trait Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D154731 | 2 年前 | |
Fix ODS verifier emission for DerivedAttr when Properties are enabled Differential Revision: https://reviews.llvm.org/D158679 | 2 年前 | |
[mlir][docgen] Change nested check Allows for single op nested regions. | 3 年前 | |
Fix some missing fully qualified namespaces in MLIR TableGen generator Using properties would break when a dialect isn't in the mlir namespace | 2 年前 | |
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 | 4 年前 | |
[mlir] Hoist out getRequestedOpDefinitions helper Enables performing the same filtering in the op doc definition as in the op definition generator. Differential Revision: https://reviews.llvm.org/D99793 | 5 年前 | |
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 | 4 年前 | |
[mlir] Move tblgen code generation to use functional forms of cast/isa Summary: The method forms are deprecated. This updates the rest of the tblgen uses of methods where a function call is available. 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 Reviewers: rriddle | 3 年前 | |
Finish renaming getOperandSegmentSizeAttr() from operand_segment_sizes to operandSegmentSizes This renaming started with the native ODS support for properties, this is completing it. A mass automated textual rename seems safe for most codebases. Drop also the ods prefix to keep the accessors the same as they were before this change: properties.odsOperandSegmentSizes reverts back to: properties.operandSegementSizes The ODS prefix was creating divergence between all the places and make it harder to be consistent. Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D157173 | 2 年前 | |
[mlir] Fix -Wstrict-prototypes warning These warnings prevent compilation using clang and -DLLVM_ENABLE_WERROR=On. Differential revision: https://reviews.llvm.org/D139322 | 3 年前 | |
[MLIR][Doc] Also print summarys for passes on a newline This patch is improves upon https://reviews.llvm.org/D152621. There, I pointed out some issues with D152621, which I'll repeat here. > Passes use a different logic for generating the documentation; which I didn't update to be in-line with this change. Fixed by defining and using mlir::tblgen::emitSummary. This is now used in OpDocGen.cpp and PassDocGen.cpp. Note that the passes documentation currently prints the summary behind the pass argument. For example: #### -arm-neon-2d-to-intr: Convert Arm NEON structured ops to intrinsics at https://mlir.llvm.org/docs/Passes/#-promote-buffers-to-stack-promotes-heap-based-allocations-to-automatically-managed-stack-based-allocations. This currently differs from how the summary is printed for Ops. For example: #### amdgpu.lds_barrier (::mlir::amdgpu::LDSBarrierOp) ¶ **Summary:** _Barrier that includes a wait for LDS memory operations._ at https://mlir.llvm.org/docs/Dialects/AMDGPU/#amdgpulds_barrier-mliramdgpuldsbarrierop. The changes in this patch ensure that: 1. The summary is always printed on a new line. 2. The summary is always printed in italic. 3. The summary always starts with a capital letter. I've dropped the **Summary:**, which was introduced in D152621, because only italicization should be already clear enough. > amx.tdpbssd shows **Summary:** __ meaning that apparently hasSummary does not guarantee a non-empty summary. This is fixed by double-checking !summary.empty(), because the following code cpp void mlir::tblgen::emitSummary(StringRef summary, raw_ostream &os) { if (!summary.empty()) { char first = std::toupper(summary.front()); llvm::StringRef rest = summary.drop_front(); os << "\n_" << first << rest << "_\n\n"; } else { os << "\n_" << "foo" << "_\n\n"; } } generates the following Markdown: `` ### amx.tdpbssd (::mlir::amx::x86_amx_tdpbssd) _foo_ ` in tools/mlir/docs/Dialects/AMX.md`. > Summary fields containing * cancel the italicization, so the * should probably be escaped to solve this. EDIT: Nope. This is because mlir-www runs Hugo 0.80 whereas 0.111 correctly parses _Raw Buffer Floating-point Atomic Add (MI-* only)_ as an italicized string. This will be fixed by https://github.com/llvm/mlir-www/pull/152. Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D152648 | 3 年前 | |
[TableGen] llvm::Optional => std::optional | 3 年前 | |
[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. 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 patch updates all remaining uses of the deprecated functionality in mlir/. This was done with clang-tidy as described below and further modifications to GPUBase.td and OpenMPOpsInterfaces.td. 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: 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. 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 Differential Revision: https://reviews.llvm.org/D151542 | 3 年前 | |
[mlirv][spirv] Add KHR Cooperative Matrix type and extension Start plumbing through support for the SPV_KHR_cooperative_matrix extension: https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/KHR/SPV_KHR_cooperative_matrix.html. Register the extension, add new coop matrix type, and add spirv.KHR.CooperativeMatrixLength op to exercise it. Make sure that mixing of the KHR and NV coop matrix extensions is not allowed. Make cast verification more robust. Reviewed By: antiagainst, qedawkins Differential Revision: https://reviews.llvm.org/D154877 | 2 年前 | |
[mlir][tblgen] Refact mlir-tblgen main into its own library This has previously been done for mlir-opt and mlir-reduce and roughly the same approach has been done here. The use case for having a separate library is that it is easier for downstream to make custom TableGen backends/executable that work on top of the utilities that are defined in mlir/TableGen. The customization point here is the same one as for any upstream TableGen backends: One can add a new generator by simply creating a global instance of mlir::GenRegistration. Differential Revision: https://reviews.llvm.org/D131112 | 3 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 3 年前 |