|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init |
|
| #
edfc4bb9 |
| 19-Jul-2022 |
Jeff Niu <[email protected]> |
[mlir][ods] Remove warning in `AttrOrTypeDef`
This warning was added because using attribute or type assembly formats with `skipDefaultBuilders` set could cause compilation errors, since the require
[mlir][ods] Remove warning in `AttrOrTypeDef`
This warning was added because using attribute or type assembly formats with `skipDefaultBuilders` set could cause compilation errors, since the required builder prototype may not necessarily be generated and would need to be checked by hand. This patch removes the warning because a warning that the generated C++ "might" not compile is not particularly useful. Attempting to address the TODO (i.e. detect whether a builder of the correct prototype is provided) would be fragile since it would not be possible to account for implicit conversions, etc.
In general, ODS should not be emitting warnings in cases like these.
Reviewed By: rriddle, wrengr
Differential Revision: https://reviews.llvm.org/D130102
show more ...
|
| #
2d05418b |
| 19-Jul-2022 |
Jeff Niu <[email protected]> |
Revert "[mlir][ods] (NFC) Remove warning in `AttrOrTypeDef`"
This reverts commit e45ef5ebf4402e553c9a0b10e8765811cc33bbdd.
|
| #
e45ef5eb |
| 19-Jul-2022 |
Jeff Niu <[email protected]> |
[mlir][ods] (NFC) Remove warning in `AttrOrTypeDef`
This warning was added because using attribute or type assembly formats with `skipDefaultBuilders` set could cause compilation errors, since the r
[mlir][ods] (NFC) Remove warning in `AttrOrTypeDef`
This warning was added because using attribute or type assembly formats with `skipDefaultBuilders` set could cause compilation errors, since the required builder prototype may not necessarily be generated and would need to be checked by hand. This patch removes the warning because a warning that the generated C++ "might" not compile is not particularly useful. Attempting to address the TODO (i.e. detect whether a builder of the correct prototype is provided) would be fragile since it would not be possible to account for implicit conversions, etc.
In general, ODS should not be emitting warnings in cases like these.
show more ...
|
| #
7f76471e |
| 19-Jul-2022 |
bhatuzdaname <[email protected]> |
[mlir][tblgen] Add support for extraClassDefinition in AttrDef
For AttrDef declarations, place specified code in extraClassDefinition into the generated *.cpp.inc file.
Reviewed By: Mogball, rriddl
[mlir][tblgen] Add support for extraClassDefinition in AttrDef
For AttrDef declarations, place specified code in extraClassDefinition into the generated *.cpp.inc file.
Reviewed By: Mogball, rriddle
Differential Revision: https://reviews.llvm.org/D129574
show more ...
|
| #
7fe2294e |
| 14-Jul-2022 |
Jeff Niu <[email protected]> |
[mlir][ods] Allow specifying return types of builders
This patch allows custom attribute and type builders to return something other than the C++ type of the attribute or type.
This is useful for a
[mlir][ods] Allow specifying return types of builders
This patch allows custom attribute and type builders to return something other than the C++ type of the attribute or type.
This is useful for attributes or types that may perform extra work during construction (e.g. canonicalization) that could result in a different kind of attribute or type being returned.
Reviewed By: rriddle, lattner
Differential Revision: https://reviews.llvm.org/D129792
show more ...
|
| #
c27d8152 |
| 14-Jul-2022 |
Kazu Hirata <[email protected]> |
[mlir] Use value instead of getValue (NFC)
|
| #
c0db2b75 |
| 06-Jul-2022 |
wren romano <[email protected]> |
[mlir][tblgen] Reverting fatality of assemblyFormat with skipDefaultBuilders=1
Per @rriddle, we do not want to require `skipDefaultBuilders=0` per se; that is, even though the `assemblyFormat`-gener
[mlir][tblgen] Reverting fatality of assemblyFormat with skipDefaultBuilders=1
Per @rriddle, we do not want to require `skipDefaultBuilders=0` per se; that is, even though the `assemblyFormat`-generated parser requires a builder with the same prototype as the default-builder, that prototype could instead be implemented via custom `builders`. This differential reduces the FatalError introduced in D128555 to a non-fatal Warning instead, so that users can still be informed of the error condition (rather than waiting for the C++ compiler to fail).
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D129234
show more ...
|
| #
46394861 |
| 27-Jun-2022 |
wren romano <[email protected]> |
[mlir][tblgen] Improving error messages
This differential improves two error conditions, by detecting them earlier and by providing better messages to help users understand what went wrong.
Reviewe
[mlir][tblgen] Improving error messages
This differential improves two error conditions, by detecting them earlier and by providing better messages to help users understand what went wrong.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D128555
show more ...
|
| #
67854f9e |
| 30-Jun-2022 |
Fangrui Song <[email protected]> |
Use value_or instead of getValueOr. NFC
|
| #
92bdc5c3 |
| 23-Jun-2022 |
Mogball <[email protected]> |
[mlir][ods] Add convertFromStorage field to parameters
This patch adds a `convertFromStorage` field to attribute or type parameters that can implement more complex logic for converting from the para
[mlir][ods] Add convertFromStorage field to parameters
This patch adds a `convertFromStorage` field to attribute or type parameters that can implement more complex logic for converting from the parameter's C++ storage type (e.g. `Optional<SmallVector<T>>`) to its C++ type (e.g. `Optional<ArrayRef<T>>`).
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D128293
show more ...
|
|
Revision tags: llvmorg-14.0.6 |
|
| #
0916d96d |
| 21-Jun-2022 |
Kazu Hirata <[email protected]> |
Don't use Optional::hasValue (NFC)
|
| #
30c67587 |
| 19-Jun-2022 |
Kazu Hirata <[email protected]> |
Use value_or instead of getValueOr (NFC)
|
| #
baca1c1a |
| 14-Jun-2022 |
Mogball <[email protected]> |
[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 corre
[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
show more ...
|
|
Revision tags: llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0 |
|
| #
23e3cbe2 |
| 12-Mar-2022 |
River Riddle <[email protected]> |
[mlir] Refactor how parser/printers are specified for AttrDef/TypeDef
There is currently an awkwardly complex set of rules for how a parser/printer is generated for AttrDef/TypeDef. It can change de
[mlir] Refactor how parser/printers are specified for AttrDef/TypeDef
There is currently an awkwardly complex set of rules for how a parser/printer is generated for AttrDef/TypeDef. It can change depending on if a mnemonic was specified, if there are parameters, if using the assemblyFormat, if individual parser/printer code blocks were specified, etc. This commit refactors this to make what the attribute/type wants more explicit, and to better align with how formats are specified for operations.
Firstly, the parser/printer code blocks are removed in favor of a `hasCustomAssemblyFormat` bit field. This aligns with the operation format specification (and is nice to remove code blocks from ODS).
This commit also adds a requirement to explicitly set `assemblyFormat` or `hasCustomAssemblyFormat` when the mnemonic is set and the attr/type has no parameters. This removes the weird implicit matrix of behavior, and also encourages the author to make a conscious choice of either C++ or declarative format instead of implicitly opting them into the C++ format (we should be pushing towards declarative when possible).
Differential Revision: https://reviews.llvm.org/D121505
show more ...
|
|
Revision tags: llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2 |
|
| #
761bc83a |
| 15-Feb-2022 |
Mogball <[email protected]> |
[mlir][ods] Default-valued parameters in attribute or type defs
Optional parameters with `defaultValue` set will be populated with that value if they aren't encountered during parsing. Moreover, par
[mlir][ods] Default-valued parameters in attribute or type defs
Optional parameters with `defaultValue` set will be populated with that value if they aren't encountered during parsing. Moreover, parameters equal to their default values are elided when printing.
Depends on D118210
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D118544
show more ...
|
|
Revision tags: llvmorg-14.0.0-rc1 |
|
| #
07486395 |
| 08-Feb-2022 |
Mogball <[email protected]> |
[mlir][ods] Optional Attribute or Type Parameters
Implements optional attribute or type parameters, including support for such parameters in the assembly format `struct` directive. Also implements o
[mlir][ods] Optional Attribute or Type Parameters
Implements optional attribute or type parameters, including support for such parameters in the assembly format `struct` directive. Also implements optional groups.
Depends on D117971
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D118208
show more ...
|
|
Revision tags: llvmorg-15-init |
|
| #
6842ec42 |
| 26-Jan-2022 |
River Riddle <[email protected]> |
[mlir][NFC] Add a using for llvm::SMLoc/llvm::SMRange to LLVM.h
These are used pervasively during parsing.
Differential Revision: https://reviews.llvm.org/D118291
|
|
Revision tags: llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2 |
|
| #
ca6bd9cd |
| 30-Nov-2021 |
Mogball <[email protected]> |
[mlir][ods] AttrOrTypeGen uses Class
AttrOrType def generator uses `Class` code gen helper, instead of naked raw_ostream.
Depends on D113714 and D114807
Reviewed By: rriddle
Differential Revision
[mlir][ods] AttrOrTypeGen uses Class
AttrOrType def generator uses `Class` code gen helper, instead of naked raw_ostream.
Depends on D113714 and D114807
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D113715
show more ...
|
|
Revision tags: llvmorg-13.0.1-rc1 |
|
| #
9a2fdc36 |
| 15-Oct-2021 |
Jeff Niu <[email protected]> |
[MLIR] Attribute and type formats in ODS
Declarative attribute and type formats with assembly formats. Define an `assemblyFormat` field in attribute and type defs with a `mnemonic` to generate a par
[MLIR] Attribute and type formats in ODS
Declarative attribute and type formats with assembly formats. Define an `assemblyFormat` field in attribute and type defs with a `mnemonic` to generate a parser and printer.
```tablegen def MyAttr : AttrDef<MyDialect, "MyAttr"> { let parameters = (ins "int64_t":$count, "AffineMap":$map); let mnemonic = "my_attr"; let assemblyFormat = "`<` $count `,` $map `>`"; } ```
Use `struct` to define a comma-separated list of key-value pairs:
```tablegen def MyType : TypeDef<MyDialect, "MyType"> { let parameters = (ins "int":$one, "int":$two, "int":$three); let mnemonic = "my_attr"; let assemblyFormat = "`<` $three `:` struct($one, $two) `>`"; } ```
Use `struct(*)` to capture all parameters.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D111594
show more ...
|
|
Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2 |
|
| #
c8d9e1ce |
| 25-Aug-2021 |
River Riddle <[email protected]> |
[mlir][AttrTypeGen] Add support for specifying a "accessor" type of a parameter
This allows for using a different type when accessing a parameter than the one used for storage. This allows for retur
[mlir][AttrTypeGen] Add support for specifying a "accessor" type of a parameter
This allows for using a different type when accessing a parameter than the one used for storage. This allows for returning parameters by reference, enables using more optimized/convient reference results, and more.
Differential Revision: https://reviews.llvm.org/D108593
show more ...
|
|
Revision tags: llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1 |
|
| #
94662ee0 |
| 15-Apr-2021 |
River Riddle <[email protected]> |
[mlir] Add support for adding attribute+type traits/interfaces to tablegen defs
This matches the current support provided to operations, and allows attaching traits, interfaces, and using the Declar
[mlir] Add support for adding attribute+type traits/interfaces to tablegen defs
This matches the current support provided to operations, and allows attaching traits, interfaces, and using the DeclareInterfaceMethods utility. This was missed when attribute/type generation was first added.
Differential Revision: https://reviews.llvm.org/D100233
show more ...
|
|
Revision tags: llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4 |
|
| #
caa7038a |
| 16-Mar-2021 |
River Riddle <[email protected]> |
[mlir][IR] Move the remaining builtin attributes to ODS.
With this revision, all builtin attributes and types will have been moved to the ODS generator.
Differential Revision: https://reviews.llvm.
[mlir][IR] Move the remaining builtin attributes to ODS.
With this revision, all builtin attributes and types will have been moved to the ODS generator.
Differential Revision: https://reviews.llvm.org/D98474
show more ...
|
| #
425e11ee |
| 16-Mar-2021 |
River Riddle <[email protected]> |
[mlir][AttrTypeDefGen] Add support for custom parameter comparators
Some parameters to attributes and types rely on special comparison routines other than operator== to ensure equality. This revisio
[mlir][AttrTypeDefGen] Add support for custom parameter comparators
Some parameters to attributes and types rely on special comparison routines other than operator== to ensure equality. This revision adds support for those parameters by allowing them to specify a `comparator` code block that determines if `$_lhs` and `$_rhs` are equal. An example of one of these paramters is APFloat, which requires `bitwiseIsEqual` for bitwise comparison (which we want for attribute equality).
Differential Revision: https://reviews.llvm.org/D98473
show more ...
|
|
Revision tags: llvmorg-12.0.0-rc3 |
|
| #
1447ec51 |
| 04-Mar-2021 |
River Riddle <[email protected]> |
[mlir][AttrDefGen] Add support for specifying the value type of an attribute
The value type of the attribute can be specified by either overriding the typeBuilder field on the AttrDef, or by providi
[mlir][AttrDefGen] Add support for specifying the value type of an attribute
The value type of the attribute can be specified by either overriding the typeBuilder field on the AttrDef, or by providing a parameter of type `AttributeSelfTypeParameter`. This removes the need to define custom storage class constructors for attributes that have a value type other than NoneType.
Differential Revision: https://reviews.llvm.org/D97590
show more ...
|
| #
83ef862f |
| 04-Mar-2021 |
River Riddle <[email protected]> |
[mlir] Add support for generating Attribute classes for ODS
The support for attributes closely maps that of Types (basically 1-1) given that Attributes are defined in exactly the same way as Types.
[mlir] Add support for generating Attribute classes for ODS
The support for attributes closely maps that of Types (basically 1-1) given that Attributes are defined in exactly the same way as Types. All of the current ODS TypeDef classes get an Attr equivalent. The generation of the attribute classes themselves share the same generator as types.
Differential Revision: https://reviews.llvm.org/D97589
show more ...
|