aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/TableGen/Argument.cpp
AgeCommit message (Collapse)Author
2021-08-23[mlir] Add support for VariadicOfVariadic operandsRiver Riddle
This revision adds native ODS support for VariadicOfVariadic operand groups. An example of this is the SwitchOp, which has a variadic number of nested operand ranges for each of the case statements, where the number of case statements is variadic. Builtin ODS support allows for generating proper accessors for the nested operand ranges, builder support, and declarative format support. VariadicOfVariadic operands are supported by providing a segment attribute to use to store the operand groups, mapping similarly to the AttrSizedOperand trait (but with a user defined attribute name). `build` methods for VariadicOfVariadic operand expect inputs of the form `ArrayRef<ValueRange>`. Accessors for the variadic ranges return a new `OperandRangeRange` type, which represents a contiguous range of `OperandRange`. In the declarative assembly format, VariadicOfVariadic operands and types are by default formatted as a comma delimited list of value lists: `(<value>, <value>), (), (<value>)`. Differential Revision: https://reviews.llvm.org/D107774
2020-08-12[MLIR][NFC] Remove tblgen:: prefix in TableGen/*.cpp filesRahul Joshi
- Add "using namespace mlir::tblgen" in several of the TableGen/*.cpp files and eliminate the tblgen::prefix to reduce code clutter. Differential Revision: https://reviews.llvm.org/D85800
2020-04-10[mlir][ODS] Add support for optional operands and results with a new ↵River Riddle
Optional directive. Summary: This revision adds support for specifying operands or results as "optional". This is a special case of variadic where the number of elements is either 0 or 1. Operands and results of this kind will have accessors generated using Value instead of the range types, making it more natural to interface with. Differential Revision: https://reviews.llvm.org/D77863
2020-01-26Mass update the MLIR license header to mention "Part of the LLVM project"Mehdi Amini
This is an artifact from merging MLIR into LLVM, the file headers are now aligned with the rest of the project.
2019-12-23Adjust License.txt file to use the LLVM licenseMehdi Amini
PiperOrigin-RevId: 286906740
2019-05-20 Remove unnecessary C++ specifier in CPP files. NFC.Jacques Pienaar
These are only required in .h files to disambiguate between C and C++ header files. -- PiperOrigin-RevId: 248219135
2019-05-06 [TableGen] Support multiple variadic operands/resultsLei Zhang
Certain ops can have multiple variadic operands/results, e.g., `tf.DynamicStitch`. Even if an op has only one variadic operand/result, it is not necessarily the very last one, e.g., `tf.RaggedGather`. This CL enhances TableGen subsystem to be able to represent such cases. In order to deduce the operand/result value range for each variadic operand, currently we only support variadic operands/results all of the same size. So two new traits, `SameVariadicOperandSize` and `SameVariadicResultSize` are introduced. -- PiperOrigin-RevId: 245310628
2019-04-18 NFC: Simplify named attribute in TableGen generatorsSmit Hinsu
Now, op attribute names don't have '.' in their names so the special handling for it can be removed. Attributes for functions still have dialect prefix with '.' as separator but TableGen does not deal with functions. TESTED with existing unit tests -- PiperOrigin-RevId: 243287462
2019-03-29Change Value to NamedTypeConstraint and use TypeConstraint.Jacques Pienaar
Previously Value was a pair of name & Type, but for operands/result a TypeConstraint rather then a Type is specified. Update C++ side to match declarative side. PiperOrigin-RevId: 238984799
2019-03-29Change the TensorFlow attribute prefix from "tf$" to "tf." to match the ↵River Riddle
specification of dialect attributes. This also fixes tblgen generation of dialect attributes that used the sugared name "tf$attr" as c++ identifiers. PiperOrigin-RevId: 236924392
2019-03-29[TableGen] Rename Operand to Value to prepare sharing between operand and resultLei Zhang
We specify op operands and results in TableGen op definition using the same syntax. They should be modelled similarly in TableGen driver wrapper classes. PiperOrigin-RevId: 234153332
2019-03-29[tablegen] Use tblgen:: classes for NamedAttribute and Operand fieldsLei Zhang
This is another step towards hiding raw TableGen API calls. PiperOrigin-RevId: 231580827
2019-03-29Pull TableGen op argument definitions into their own filesLei Zhang
PiperOrigin-RevId: 230923050