| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[MLIR][TableGen] Error on APInt parameter without custom comparator (#135970) The error is triggered when an attribute or type uses an APInt typed parameter with the generated equality operator. If the compared APInts have different bit widths the equality operator triggers an assert. This is dangerous, since StorageUniquer for types and attributes uses the equality operator when a hash collision appears. As such, it is necessary to use custom provided comarator or APIntParameter that already has it. This commit also replaces uses of the raw APInt parameter with the APIntParameter and removes the no longer necessary custom StorageClass for the BitVectorAttr from the SMT dialect that was a workaround for the described issue. --------- Co-authored-by: Tobias Gysi <tobias.gysi@nextsilicon.com> | 1 年前 | |
[MLIR][ODS] Optionally generate public C++ functions for attribute constraints (#144275) Add gen-attr-constraint-decls and gen-attr-constraint-defs, which generate public C++ functions for attribute constraints. The name of the C++ function is specified in the cppFunctionName field. This generalize cppFunctionName from TypeConstraint introduced in https://github.com/llvm/llvm-project/pull/104577 to be usable also in AttrConstraint. | 1 年前 | |
[mlir][mlir-tblgen] Emit correct error message if method is pruned (#160334) Add verification for pruned methods for emitCustomBuilder and emitCheckedCustomBuilder with proper diagnostic about shadowed methods. Without this verification, mlir-tblgen with --gen-attrdef-decls would segmentation fault if custom builder is provided with its body, but if method is pruned out due to duplication with other builders. Fixes #160227 --------- Co-authored-by: Justin Kim <jaewoo.kim@hyperaccel.ai> | 10 个月前 | |
[mlir][mlir-tblgen] Emit correct error message if method is pruned (#160334) Add verification for pruned methods for emitCustomBuilder and emitCheckedCustomBuilder with proper diagnostic about shadowed methods. Without this verification, mlir-tblgen with --gen-attrdef-decls would segmentation fault if custom builder is provided with its body, but if method is pruned out due to duplication with other builders. Fixes #160227 --------- Co-authored-by: Justin Kim <jaewoo.kim@hyperaccel.ai> | 10 个月前 | |
[TableGen] Add assert to validate Objects list for HwModeSelect (#123794) - Bail out of TableGen if any asserts fail before running the backend. - Add asserts to validate that the Objects and Modes lists for various HwModeSelect subclasses are of same length. - Eliminate equivalent check in CodeGenHWModes.cpp | 1 年前 | |
[mlir][tblgen] Add custom parsing and printing within struct (#133939) This PR extends the struct directive in tablegen to support nested custom directives. Note that this assumes/verifies that that custom directive has a single parameter. This enables defining custom field parsing and printing functions if the struct directive doesn't suffice. There is some existing potential downstream usage for it: https://github.com/openxla/stablehlo/blob/a3c7de92425e8035437dae67ab2318a82eca79a1/stablehlo/dialect/StablehloOps.cpp#L3102 | 1 年前 | |
[mlir][IR] Fix enum attribute handling by using parseKeywordOrString instead of parseKeyword (#156662) Change enum attribute parsing to handle special characters and multi-word identifiers. This allows enum attrs to use symbols like "+" and strings with separators like "dash-separated-sentence" instead of being limited to valid identifiers. This also aligns enum attribute parsing with how enums are already handled by the FieldParser: https://github.com/llvm/llvm-project/blob/main/mlir/tools/mlir-tblgen/EnumsGen.cpp#L108 Signed-off-by: Fabian Mora <fabian.mora-cordero@amd.com> | 11 个月前 | |
[mlir][IR] Improve error message when parsing incorrect type (#134984) Improve error messages when parsing an incorrect type. Before: invalid kind of type specified After: invalid kind of type specified: expected builtin.tensor, but found 'tensor<*xi32>' This error message is produced when a certain operand/result type is expected according to an op's TableGen definition, but a different type is parsed. Type constraints (which may have nice error messages) are checked after parsing a type. If an incorrect type is parsed, we never get to the point of printing type constraint error messages. This may discourage users from specifying C++ classes with type constraints. (Explicitly specifying C++ classes is beneficial because the auto-generated C++ code will have richer type information; explicit casts are unnecessary, etc.) See #134981 for an example where specifying additional type information with type constraints (e.g., LLVM_AnyVector) lead to worse error messages. Note: In order to generate a better error message, the parser must retrieve a type's name from the C++ class. TableGen-generated type classes always have a name field, but hand-written C++ type classes may not. The HasStaticName template was copied from DialectImplementation.h (HasStaticDialectName). | 1 年前 | |
[mlir][IR] Fix enum attribute handling by using parseKeywordOrString instead of parseKeyword (#156662) Change enum attribute parsing to handle special characters and multi-word identifiers. This allows enum attrs to use symbols like "+" and strings with separators like "dash-separated-sentence" instead of being limited to valid identifiers. This also aligns enum attribute parsing with how enums are already handled by the FieldParser: https://github.com/llvm/llvm-project/blob/main/mlir/tools/mlir-tblgen/EnumsGen.cpp#L108 Signed-off-by: Fabian Mora <fabian.mora-cordero@amd.com> | 11 个月前 | |
| 1 年前 | ||
[mlir][test] Fix filecheck annotation typos [2/n] (#93476) Few more fixes previous: https://github.com/llvm/llvm-project/pull/92897 pr Issues from https://github.com/llvm/llvm-project/issues/93154 unfixed. --------- Co-authored-by: klensy <nightouser@gmail.com> | 2 年前 | |
[MLIR][ODS] default-valued strings should be in quotes DefaultValuedAttr<StrAttr, ""> and ConstantAttr<StrAttr, ""> result in bugs in which TableGen will not recognize that the attribute has a default value, because "" is an empty TableGen string. Strings no longer have special treatment. Instead, string values must be wrapped in quotes: "\"foo\"". Two helpers, DefaultValuedStrAttr and ConstantStrAttr have been added to keep code clean. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D111855 | 4 年前 | |
[mlir][ods] Enable basic string interpolation in constraint summary. (#153603) This enables printing, for example, the attribute value from a mismatched predicate. Example of resultant output (here made non-negative report value seen as sign-extended int): PDL/ops.mlir:21:1: error: 'pdl.pattern' op attribute 'benefit' failed to satisfy constraint: 16-bit signless integer attribute whose value is non-negative (got -31) pdl.pattern @rewrite_with_args : benefit(-31) { ^ This is primarily the mechanism and didn't change any existing constraints. I also attempted to keep the error format as close to the original as possible - but did notice 2 errors that were inconsistent with the rest and updated them to be consistent. | 9 个月前 | |
[NFC][TableGen] Emit empty lines after/before namespace scope (#166217) Emit empty line after a namespace scope is opened and before its closed. Adjust DirectiveEmitter code empty line emission in response to this to avoid lot of unit test changes. | 9 个月前 | |
[mlir, flang] Use has_value instead of hasValue (NFC) | 3 年前 | |
[mlir] Switch default Fold API to using FoldAdaptors As mentioned in https://discourse.llvm.org/t/psa-new-improved-fold-method-signature-has-landed-please-update-your-downstream-projects/67618, it has now been about one month since the new fold API has been introduced. Any downstream users that have not yet switched, nor explicitly set useFoldAPI to kEmitRawAttributesFolder will experience a build break after this patch, requiring them to either switch to the new API or explicitly use the old one and live with the warning set by TableGen. Differential Revision: https://reviews.llvm.org/D143497 | 3 年前 | |
[mlir][ods] Add Deprecate helper Add method to tag classes/defs as deprecated. Previously deprecations were only verbally communicated and folks didn't have an active warning while building about impending removal. Add mechanism to tag defs as deprecated to allow warning users. This doesn't change any policy, it just moves deprecation warnings from comments to something more user visible. Differential Revision: https://reviews.llvm.org/D122164 | 4 年前 | |
[NFC][TableGen] Emit nested namespace definitions in NamespaceEmitter (#161958) Change NamespaceEmitter to emit nested namespace using C++17 nested namespace definitions. | 10 个月前 | |
[utils][TableGen] Implement clause aliases as alternative spellings (#141765) Use the spellings in the generated clause parser. The functions get<lang>ClauseKind and get<lang>ClauseName are not yet updated. The definitions of both clauses and directives now take a list of "Spelling"s instead of a single string. For example def ACCC_Copyin : Clause<[Spelling<"copyin">, Spelling<"present_or_copyin">, Spelling<"pcopyin">]> { ... } A "Spelling" is a versioned string, defaulting to "all versions". For background information see https://discourse.llvm.org/t/rfc-alternative-spellings-of-openmp-directives/85507 | 1 年前 | |
[mlir][tblgen] Fix crash in -gen-enum-(decls|defs) when EnumAttrInfo is not defined This should instead simply produce an empty file instead of crashing and causing a build to fail. This allows one to be more lazy in cmake code and just always generate the files for enum attributes, even if none are ever defined in the dialect. Differential Revision: https://reviews.llvm.org/D135355 | 3 年前 | |
[mlir] Decouple enum generation from attributes, adding EnumInfo and EnumCase (#132148) This commit pulls apart the inherent attribute dependence of classes like EnumAttrInfo and EnumAttrCase, factoring them out into simpler EnumCase and EnumInfo variants. This allows specifying the cases of an enum without needing to make the cases, or the EnumInfo itself, a subclass of SignlessIntegerAttrBase. The existing classes are retained as subclasses of the new ones, both for backwards compatibility and to allow attribute-specific information. In addition, the new BitEnum class changes its default printer/parser behavior: cases when multiple keywords appear, like having both nuw and nsw in overflow flags, will no longer be quoted by the operator<<, and the FieldParser instance will now expect multiple keywords. All instances of BitEnumAttr retain the old behavior. | 1 年前 | |
[MLIR][Python] MLIR Enum Python bindings infinite recursion (#151584) (#151588) Fixes an infinite recursion bug when using I32BitEnumAttrCaseGroup with python bindings. For more info, see issue: - https://github.com/llvm/llvm-project/issues/151584 | 1 年前 | |
[mlir] Split out AttrDef/TypeDef and pattern constructs from OpBase.td OpBase.td has formed into a huge monolith of all ODS constructs. This commits starts to rectify that by splitting out some constructs to their own .td files. Differential Revision: https://reviews.llvm.org/D118636 | 4 年前 | |
[MLIR] Make generated markdown doc more consistent (#119926) A few changes to doc generation: - All summaries are in italics. - In general each optional block starts and ends with a newline. - All table elements are enclosed in |'s - Overall reduce the number of >2newlines in a row Rationale for this change is that our markdown to docs generator requires a newline before all headers, otherwise it gets inlined into the line before it, see ### sdy-op-priority-propagate in the image below. <img width="883" alt="image" src="https://github.com/user-attachments/assets/b795c424-cecb-48df-abbe-aee2030f4491" /> That said overall I feel this formatting is more consistent now, here's a before and after: - Dialect documentation diff: https://www.diffchecker.com/OVMHoXeL/ - Pass documentation diff: https://www.diffchecker.com/XEJRmW3k/ | 1 年前 | |
[MLIR] Make generated markdown doc more consistent (#119926) A few changes to doc generation: - All summaries are in italics. - In general each optional block starts and ends with a newline. - All table elements are enclosed in |'s - Overall reduce the number of >2newlines in a row Rationale for this change is that our markdown to docs generator requires a newline before all headers, otherwise it gets inlined into the line before it, see ### sdy-op-priority-propagate in the image below. <img width="883" alt="image" src="https://github.com/user-attachments/assets/b795c424-cecb-48df-abbe-aee2030f4491" /> That said overall I feel this formatting is more consistent now, here's a before and after: - Dialect documentation diff: https://www.diffchecker.com/OVMHoXeL/ - Pass documentation diff: https://www.diffchecker.com/XEJRmW3k/ | 1 年前 | |
mlir/LogicalResult: move into llvm (#97309) This patch is part of a project to move the Presburger library into LLVM. | 2 年前 | |
[MLIR][ODS] Add support for overloading interface methods (#161828) This allows to define multiple interface methods with the same name but different arguments. | 10 个月前 | |
[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 | 3 年前 | |
[mlir-tblgen] trim method body to empty with only spaces to avoid crash (#139568) method body or default impl must be true empty. Even they contain only spaces, mlir-tblgen considers they are non-empty and generates invalid code lead to segment fault. It's very hard to debug. c++ InterfaceMethod< ... /*methodBody=*/ [{ }], // This must be true empty. Leaving a space here can lead to segment fault which is hard to figure out why /*defaultImpl=*/ [{ ... }] This PR trim spaces when method body or default implementation of interface method is not empty. Now mlir-tblgen generates valid code even when they contain only spaces. --------- Co-authored-by: Fung Xie <ftse@nvidia.com> Co-authored-by: Mehdi Amini <joker.eph@gmail.com> | 1 年前 | |
[mlir][ods] Enable basic string interpolation in constraint summary. (#153603) This enables printing, for example, the attribute value from a mismatched predicate. Example of resultant output (here made non-negative report value seen as sign-extended int): PDL/ops.mlir:21:1: error: 'pdl.pattern' op attribute 'benefit' failed to satisfy constraint: 16-bit signless integer attribute whose value is non-negative (got -31) pdl.pattern @rewrite_with_args : benefit(-31) { ^ This is primarily the mechanism and didn't change any existing constraints. I also attempted to keep the error format as close to the original as possible - but did notice 2 errors that were inconsistent with the rest and updated them to be consistent. | 9 个月前 | |
[MLIR] Fix FileCheck annotations and add 32-bit coverage (#167149) Addresses #93154 by ensuring the test RUN/FILECHECK prefixes across mlir/test/Conversion/FuncToLLVM/ and related files match their expected outputs, and adds an index-bitwidth=32 variant of expand-then-convert-to-llvm.mlir that exercises @collapse_shape_dynamic_with_non_identity_layout through the same MemRef-to-LLVM pipeline so the 32-bit layout descriptors are verified. | 9 个月前 | |
[mlir-tblgen] Relax builder ambiguity check (#118310) The mlir-tblgen tool prevents the parameter of the build() constructor for the first default-valued attribute of an operation from having a default value to avoid ambiguity with the corresponding build() constructor taking unwrapped value. However it does so even when earlier wrapped unwrappable attribute would lift the ambiguity. This commit relax the logic accordingly, which allows to remove a manual constructor in Arith dialect. | 1 年前 | |
[mlir][IR] Remove ShapedType::getSizeInBits This function returns incorrect values for memrefs and vectors due to "widening". Differential Revision: https://reviews.llvm.org/D148501 | 3 年前 | |
[mlir] Support verification order (1/3) This CL supports adding dependency between traits verifiers and the dependency will be checked statically. Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D115135 | 4 年前 | |
[mlir][omp] Add omp.tile operation (#160292) Add the omp.tile loop transformations for the OpenMP dialect. Used for lowering a standalone !$omp tile in Flang. | 10 个月前 | |
[mlir][omp] Add omp.tile operation (#160292) Add the omp.tile loop transformations for the OpenMP dialect. Used for lowering a standalone !$omp tile in Flang. | 10 个月前 | |
[mlir][ods] Fix verification of attribute + colon type ambiguity An attribute without a type builder followed by a colon in an assembly format is potentially ambiguous because the parser will read ahead to parse the colon-type and pass this as the type argument to the attribute's constructor. However, the previous verifier that checks for this ambiguity erroneously produces an error in the case of `` let assemblyFormat = "( ( $attr ) )? :"; This patch fixes the bug by implementing a checker that correctly handles all edge cases, including very strange assembly formats like: let assemblyFormat = "( ( $attr ) : (>)? attr-dict (> $a^) : (<)? :"; `` Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D125445 | 4 年前 | |
| 1 年前 | ||
[mlir][tblgen] Fix region and successor references in custom directives (#146242) Previously, references to regions and successors were incorrectly disallowed outside the top-level assembly form. This change enables the use of bound regions and successors as variables in custom directives. | 1 年前 | |
[mlir][TableGen] Emit interface traits after all interfaces (#147699) Interface traits may provide default implementation of methods. When this happens, the implementation may rely on another interface that is not yet defined meaning that one gets "incomplete type" error during C++ compilation. In pseudo-code, the problem is the following: InterfaceA has methodB() { return InterfaceB(); } InterfaceB defined later // What's generated is: class InterfaceA { ... } class InterfaceATrait { // error: InterfaceB is an incomplete type InterfaceB methodB() { return InterfaceB(); } } class InterfaceB { ... } // defined here The two more "advanced" cases are: * Cyclic dependency (A requires B and B requires A) * Type-traited usage of an incomplete type (e.g. FailureOr<InterfaceB>) It seems reasonable to emit interface traits *after* all of the interfaces have been defined to avoid the problem altogether. As a drive by, make forward declarations of the interfaces early so that user code does not need to forward declare. | 10 个月前 | |
[mlir-tblgen] Emit named operand indices (#146839) An operation's operands are defined by the arguments field in the tablegen definition. mlir-tblgen generates accessors for them: getXYZ() and setXYZ(...) to set an operation's operands without knowing the operand's index, but it does not expose the operand index itself. Yet some use cases requires knowing the operand index that is now covered by just getters and setters. For instance: * Given an mlir::OpOperand, find out whether it is a specific argument (from the arguments field in the .td file) * For operation with variable number of operands (variadic, AttrSizedOperandSegments), get the value to pass to getODSOperands or getODSOperandIndexAndLength. | 1 年前 | |
[mlir][ods] Enable basic string interpolation in constraint summary. (#153603) This enables printing, for example, the attribute value from a mismatched predicate. Example of resultant output (here made non-negative report value seen as sign-extended int): PDL/ops.mlir:21:1: error: 'pdl.pattern' op attribute 'benefit' failed to satisfy constraint: 16-bit signless integer attribute whose value is non-negative (got -31) pdl.pattern @rewrite_with_args : benefit(-31) { ^ This is primarily the mechanism and didn't change any existing constraints. I also attempted to keep the error format as close to the original as possible - but did notice 2 errors that were inconsistent with the rest and updated them to be consistent. | 9 个月前 | |
[mlir-tblgen] Suffix underscore to prevent conflict (#166017) In the case where the property name is value, the generated op def file would have a collision for hash_value. | 9 个月前 | |
[MLIR] [Python] ir.Value is now generic in the type of the value it holds (#166148) This makes it similar to mlir::TypedValue in the MLIR C++ API and allows users to be more specific about the values they produce or accept. Co-authored-by: Maksim Levental <maksim.levental@gmail.com> | 9 个月前 | |
| 1 年前 | ||
[mlir][side effect] refactor(*): Include more precise side effects (#94213) This patch adds more precise side effects to the current ops with memory effects, allowing us to determine which OpOperand/OpResult/BlockArgument the operation reads or writes, rather than just recording the reading and writing of values. This allows for convenient use of precise side effects to achieve analysis and optimization. Related discussions: https://discourse.llvm.org/t/rfc-add-operandindex-to-sideeffect-instance/79243 | 2 年前 | |
[MLIR][OpenMP] Improve assemblyFormat handling for clause-based ops (#108023) This patch modifies the representation of OpenMP_Clause to allow definitions to incorporate both required and optional arguments while still allowing operations including them and overriding the assemblyFormat to take advantage of automatically-populated format strings. The proposed approach is to split the assemblyFormat clause property into reqAssemblyFormat and optAssemblyFormat, and remove the isRequired template and associated required property. The OpenMP_Op class, in turn, populates the new clausesReqAssemblyFormat and clausesOptAssemblyFormat properties in addition to clausesAssemblyFormat. These properties can be used by clause-based OpenMP operation definitions to reconstruct parts of the clause-inherited format string in a more flexible way when overriding it. Clause definitions are updated to follow this new approach and some operation definitions overriding the assemblyFormat are simplified by taking advantage of the improved flexibility, reducing code duplication. The verify-openmp-ops tablegen pass is updated for the new OpenMP_Clause representation. Some MLIR and Flang unit tests had to be updated due to changes to the default printing order of clauses on updated operations. | 1 年前 | |
[MLIR][OpenMP] Improve assemblyFormat handling for clause-based ops (#108023) This patch modifies the representation of OpenMP_Clause to allow definitions to incorporate both required and optional arguments while still allowing operations including them and overriding the assemblyFormat to take advantage of automatically-populated format strings. The proposed approach is to split the assemblyFormat clause property into reqAssemblyFormat and optAssemblyFormat, and remove the isRequired template and associated required property. The OpenMP_Op class, in turn, populates the new clausesReqAssemblyFormat and clausesOptAssemblyFormat properties in addition to clausesAssemblyFormat. These properties can be used by clause-based OpenMP operation definitions to reconstruct parts of the clause-inherited format string in a more flexible way when overriding it. Clause definitions are updated to follow this new approach and some operation definitions overriding the assemblyFormat are simplified by taking advantage of the improved flexibility, reducing code duplication. The verify-openmp-ops tablegen pass is updated for the new OpenMP_Clause representation. Some MLIR and Flang unit tests had to be updated due to changes to the default printing order of clauses on updated operations. | 1 年前 | |
[MLIR][OpenMP] Improve assemblyFormat handling for clause-based ops (#108023) This patch modifies the representation of OpenMP_Clause to allow definitions to incorporate both required and optional arguments while still allowing operations including them and overriding the assemblyFormat to take advantage of automatically-populated format strings. The proposed approach is to split the assemblyFormat clause property into reqAssemblyFormat and optAssemblyFormat, and remove the isRequired template and associated required property. The OpenMP_Op class, in turn, populates the new clausesReqAssemblyFormat and clausesOptAssemblyFormat properties in addition to clausesAssemblyFormat. These properties can be used by clause-based OpenMP operation definitions to reconstruct parts of the clause-inherited format string in a more flexible way when overriding it. Clause definitions are updated to follow this new approach and some operation definitions overriding the assemblyFormat are simplified by taking advantage of the improved flexibility, reducing code duplication. The verify-openmp-ops tablegen pass is updated for the new OpenMP_Clause representation. Some MLIR and Flang unit tests had to be updated due to changes to the default printing order of clauses on updated operations. | 1 年前 | |
[mlir] Execute same operand name constraints before user constraints. (#162526) For a pattern like this: Pat<(MyOp $x, $x), (...), [(MyCheck $x)]>; The old implementation generates: Pat<(MyOp $x0, $x1), (...), [(MyCheck $x0), ($x0 == $x1)]>; This is not very straightforward, because the $x name appears in the source pattern; it's attempting to assume equality check will be performed as part of the source pattern matching. This commit moves the equality checks before the other constraints, i.e.: Pat<(MyOp $x0, $x1), (...), [($x0 == $x1), (MyCheck $x0)]>; | 10 个月前 | |
[mlir][ods] Enable basic string interpolation in constraint summary. (#153603) This enables printing, for example, the attribute value from a mismatched predicate. Example of resultant output (here made non-negative report value seen as sign-extended int): PDL/ops.mlir:21:1: error: 'pdl.pattern' op attribute 'benefit' failed to satisfy constraint: 16-bit signless integer attribute whose value is non-negative (got -31) pdl.pattern @rewrite_with_args : benefit(-31) { ^ This is primarily the mechanism and didn't change any existing constraints. I also attempted to keep the error format as close to the original as possible - but did notice 2 errors that were inconsistent with the rest and updated them to be consistent. | 9 个月前 | |
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][NFC] update mlir/Dialect create APIs (29/n) (#150642) See https://github.com/llvm/llvm-project/pull/147168 for more info. | 1 年前 | |
[mlir][drr] Add warning for simple case of mismatched variadic. (#84040) When a variadic argument is expected but not provided the compilation fails later with a difficult to follow compilation error. Add a simple check to catch one such case. This is not yet general as it doesn't yet check leaf nodes. | 2 年前 | |
[mlir][NFC] update mlir/Dialect create APIs (29/n) (#150642) See https://github.com/llvm/llvm-project/pull/147168 for more info. | 1 年前 | |
[mlir] Allow using non-attribute properties in declarative rewrite patterns (#143071) This commit adds support for non-attribute properties (such as StringProp and I64Prop) in declarative rewrite patterns. The handling for properties follows the handling for attributes in most cases, including in the generation of static matchers. Constraints that are shared between multiple types are supported by making the constraint matcher a templated function, which is the equivalent to passing ::mlir::Attribute for an arbitrary C++ type. | 1 年前 | |
[mlir][ods] Allow sharding of op definitions (#89423) Adds an option to mlir-tblgen -gen-op-defs op-shard-count=N that divides the op class definitions and op list into N segments, e.g. // mlir-tblgen -gen-op-defs -op-shard-count=2 void FooDialect::initialize() { addOperations< >(); addOperations< >(); } When split across multiple source files, this can help significantly improve dialect compile time for dialects with a large opset. | 2 年前 | |
Add AsmParser::parseDecimalInteger. (#96255) An attribute parser needs to parse lists of possibly negative integers separated by x in a way which is foiled by parseInteger handling hex formats and parseIntegerInDimensionList does not allow negatives. --------- Co-authored-by: Jacques Pienaar <jpienaar@google.com> | 2 年前 | |
[mlir][NFC] Update textual references of func to func.func in tool/runner tests The special case parsing of func operations is being removed. | 4 年前 | |
[mlir][NFC] Update textual references of func to func.func in tool/runner tests The special case parsing of func operations is being removed. | 4 年前 | |
[mlir][ODS] Optionally generate public C++ functions for type constraints (#104577) Add gen-type-constraint-decls and gen-type-constraint-defs, which generate public C++ functions for type constraints. The name of the C++ function is specified in the cppFunctionName field. Type constraints are typically used for op/type/attribute verification. They are also sometimes called from builders and transformations. Until now, this required duplicating the check in C++. Note: This commit just adds the option for type constraints, but attribute constraints could be supported in the same way. Alternatives considered: 1. The C++ functions could also be generated as part of gen-typedef-decls/defs, but that can be confusing because type constraints may rely on type definitions from multiple .td files. #includes could cause duplicate definitions of the same type constraint. 2. The C++ functions could also be generated as static member functions of dialects, but they don't really belong to a dialect. (Because they may rely on type definitions from multiple dialects.) | 1 年前 | |
mlir/LogicalResult: move into llvm (#97309) This patch is part of a project to move the Presburger library into LLVM. | 2 年前 | |
[mlir] Add trait SameOperandsAndResultRank This adds a native op trait SameOperandsAndResultRank and associated verifier that checks that an operator's operands and result types have same ranks if their ranks are known. Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I2d536f77be10f3710d0c8d84c907ff492a984fda Reviewed By: rsuderman Differential Revision: https://reviews.llvm.org/D156369 | 2 年前 | |
[mlir][ODS] Add OptionalTypesMatchWith and remove a custom assemblyFormat (#68876) This is just a slight specialization of TypesMatchWith that returns success if an optional parameter is missing. There may be other places this could help e.g.: https://github.com/llvm/llvm-project/blob/eb21049b4b904b072679ece60e73c6b0dc0d1ebf/mlir/include/mlir/Dialect/X86Vector/X86Vector.td#L58-L59 ...but I'm leaving those to avoid some churn. This constraint will be handy for us in some later patches, it's a formalization of a short circuiting trick with the comparator of the TypesMatchWith constraint (devised for #69195). `` TypesMatchWith< "padding type matches element type of result (if present)", "result", "padding", "::llvm::cast<VectorType>($_self).getElementType()", // This returns true if no padding is present, or it's present with a type that matches the element type of result. "!getPadding() || std::equal_to<>()"> This is a little non-obvious, so after this patch you can instead do: OptionalTypesMatchWith< "padding type matches element type of result (if present)", "result", "padding", "::llvm::cast<VectorType>($_self).getElementType()"> `` | 2 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 年前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 9 个月前 | ||
| 9 个月前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 10 个月前 | ||
| 1 年前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 10 个月前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 9 个月前 | ||
| 9 个月前 | ||
| 1 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 1 年前 | ||
| 9 个月前 | ||
| 9 个月前 | ||
| 9 个月前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 9 个月前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 |