|
MLIR 24.0.0git
|
NamedAttrList is array of NamedAttributes that tracks whether it is sorted and does some basic work to remain sorted. More...
#include "mlir/IR/OperationSupport.h"
Public Types | |
| using | iterator = SmallVectorImpl<NamedAttribute>::iterator |
| using | const_iterator = SmallVectorImpl<NamedAttribute>::const_iterator |
| using | reference = NamedAttribute & |
| using | const_reference = const NamedAttribute & |
| using | size_type = size_t |
Public Member Functions | |
| NamedAttrList () | |
| NamedAttrList (ArrayRef< NamedAttribute > attributes) | |
| NamedAttrList (DictionaryAttr attributes) | |
| NamedAttrList (const_iterator inStart, const_iterator inEnd) | |
| template<typename Container> | |
| NamedAttrList (const Container &vec) | |
| bool | operator!= (const NamedAttrList &other) const |
| bool | operator== (const NamedAttrList &other) const |
| void | append (StringRef name, Attribute attr) |
| Add an attribute with the specified name. | |
| void | append (StringAttr name, Attribute attr) |
| Add an attribute with the specified name. | |
| void | append (NamedAttribute attr) |
| Append the given named attribute. | |
| template<typename RangeT> | |
| void | append (RangeT &&newAttributes) |
| Add an array of named attributes. | |
| template<typename IteratorT, typename = std::enable_if_t<std::is_convertible< typename std::iterator_traits<IteratorT>::iterator_category, std::input_iterator_tag>::value>> | |
| void | append (IteratorT inStart, IteratorT inEnd) |
| Add a range of named attributes. | |
| void | assign (const_iterator inStart, const_iterator inEnd) |
| Replaces the attributes with new list of attributes. | |
| void | assign (ArrayRef< NamedAttribute > range) |
| Replaces the attributes with new list of attributes. | |
| void | clear () |
| bool | empty () const |
| void | reserve (size_type N) |
| void | push_back (NamedAttribute newAttribute) |
| Add an attribute with the specified name. | |
| void | pop_back () |
| Pop last element from list. | |
| std::optional< NamedAttribute > | findDuplicate () const |
| Returns an entry with a duplicate name the list, if it exists, else returns std::nullopt. | |
| DictionaryAttr | getDictionary (MLIRContext *context) const |
| Return a dictionary attribute for the underlying dictionary. | |
| ArrayRef< NamedAttribute > | getAttrs () const |
| Return all of the attributes on this operation. | |
| Attribute | get (StringAttr name) const |
| Return the specified attribute if present, null otherwise. | |
| Attribute | get (StringRef name) const |
| Return the specified attribute if present, null otherwise. | |
| std::optional< NamedAttribute > | getNamed (StringRef name) const |
| Return the specified named attribute if present, std::nullopt otherwise. | |
| std::optional< NamedAttribute > | getNamed (StringAttr name) const |
| Attribute | set (StringAttr name, Attribute value) |
| If the an attribute exists with the specified name, change it to the new value. | |
| Attribute | set (StringRef name, Attribute value) |
| Attribute | erase (StringAttr name) |
| Erase the attribute with the given name from the list. | |
| Attribute | erase (StringRef name) |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| NamedAttrList & | operator= (const SmallVectorImpl< NamedAttribute > &rhs) |
| operator ArrayRef< NamedAttribute > () const | |
NamedAttrList is array of NamedAttributes that tracks whether it is sorted and does some basic work to remain sorted.
Definition at line 864 of file OperationSupport.h.
| using mlir::NamedAttrList::const_iterator = SmallVectorImpl<NamedAttribute>::const_iterator |
Definition at line 867 of file OperationSupport.h.
| using mlir::NamedAttrList::const_reference = const NamedAttribute & |
Definition at line 869 of file OperationSupport.h.
| using mlir::NamedAttrList::iterator = SmallVectorImpl<NamedAttribute>::iterator |
Definition at line 866 of file OperationSupport.h.
| using mlir::NamedAttrList::reference = NamedAttribute & |
Definition at line 868 of file OperationSupport.h.
| using mlir::NamedAttrList::size_type = size_t |
Definition at line 870 of file OperationSupport.h.
|
inline |
Definition at line 872 of file OperationSupport.h.
Referenced by NamedAttrList(), NamedAttrList(), operator!=(), and operator==().
| NamedAttrList::NamedAttrList | ( | ArrayRef< NamedAttribute > | attributes | ) |
Definition at line 81 of file OperationSupport.cpp.
References assign().
| NamedAttrList::NamedAttrList | ( | DictionaryAttr | attributes | ) |
Definition at line 85 of file OperationSupport.cpp.
References NamedAttrList().
| NamedAttrList::NamedAttrList | ( | const_iterator | inStart, |
| const_iterator | inEnd ) |
Definition at line 91 of file OperationSupport.cpp.
References assign().
|
inline |
Definition at line 878 of file OperationSupport.h.
References NamedAttrList().
|
inline |
Add a range of named attributes.
Definition at line 912 of file OperationSupport.h.
|
inline |
Append the given named attribute.
Definition at line 899 of file OperationSupport.h.
References push_back().
|
inline |
Add an array of named attributes.
Definition at line 903 of file OperationSupport.h.
References append().
Add an attribute with the specified name.
Definition at line 894 of file OperationSupport.h.
References append().
Add an attribute with the specified name.
Definition at line 889 of file OperationSupport.h.
References append().
Referenced by append(), append(), append(), mlir::GPUFuncOpLowering::buildLoweredGPULLVMFuncAttrs(), mlir::ROCDL::getAMDHSAKernelsELFMetadata(), mlirLinalgFillBuiltinNamedOpRegion(), mlir::AsmParser::parseAttribute(), parseCommonStructuredOpParts(), mlir::AsmParser::parseCustomAttributeWithFallback(), parseMmaEnumPropertyValue(), parseMmaProperties(), parseMmaPropertyValue(), mlir::AsmParser::parseOptionalAttribute(), mlir::AsmParser::parseOptionalSymbolName(), mlir::AsmParser::parseSymbolName(), mlir::OperationName::populateInherentAttrs(), mlir::CallGraph::print(), mlir::function_interface_impl::printFunctionAttributes(), printShortForm(), and mlir::Operation::setDialectAttrs().
|
inline |
Replaces the attributes with new list of attributes.
Definition at line 923 of file OperationSupport.h.
References assign().
| void NamedAttrList::assign | ( | const_iterator | inStart, |
| const_iterator | inEnd ) |
Replaces the attributes with new list of attributes.
Definition at line 118 of file OperationSupport.cpp.
Referenced by assign(), NamedAttrList(), NamedAttrList(), and operator=().
|
inline |
Definition at line 974 of file OperationSupport.h.
|
inline |
Definition at line 976 of file OperationSupport.h.
|
inline |
Definition at line 927 of file OperationSupport.h.
|
inline |
Definition at line 932 of file OperationSupport.h.
Referenced by mlir::lowerDiscardableAttrsForLLVMFunc(), mlir::GPUFuncOpLowering::matchAndRewrite(), and mlir::CallGraph::print().
|
inline |
Definition at line 975 of file OperationSupport.h.
|
inline |
Definition at line 977 of file OperationSupport.h.
| Attribute NamedAttrList::erase | ( | StringAttr | name | ) |
Erase the attribute with the given name from the list.
Return the attribute that was erased, or nullptr if there was no attribute with such name.
Definition at line 194 of file OperationSupport.cpp.
Referenced by computeHash(), mlir::GPUFuncOpLowering::matchAndRewrite(), mlir::function_interface_impl::removeArgAttr(), mlir::Operation::removeAttr(), mlir::Operation::removeDiscardableAttr(), and mlir::function_interface_impl::removeResultAttr().
| Attribute NamedAttrList::erase | ( | StringRef | name | ) |
Definition at line 199 of file OperationSupport.cpp.
| std::optional< NamedAttribute > NamedAttrList::findDuplicate | ( | ) | const |
Returns an entry with a duplicate name the list, if it exists, else returns std::nullopt.
Definition at line 97 of file OperationSupport.cpp.
| Attribute NamedAttrList::get | ( | StringAttr | name | ) | const |
Return the specified attribute if present, null otherwise.
Definition at line 135 of file OperationSupport.cpp.
Referenced by inferAndSetMultiplicandTypes(), mlir::function_interface_impl::parseFunctionOp(), parseMmaEnumPropertyValue(), parseMmaProperties(), parseMmaPropertyValue(), and mlir::spirv::printVariableDecorations().
| Attribute NamedAttrList::get | ( | StringRef | name | ) | const |
Return the specified attribute if present, null otherwise.
Definition at line 131 of file OperationSupport.cpp.
| ArrayRef< NamedAttribute > NamedAttrList::getAttrs | ( | ) | const |
Return all of the attributes on this operation.
Definition at line 95 of file OperationSupport.cpp.
Referenced by buildStructuredOp().
| DictionaryAttr NamedAttrList::getDictionary | ( | MLIRContext * | context | ) | const |
Return a dictionary attribute for the underlying dictionary.
This will return an empty dictionary attribute if empty rather than null.
Definition at line 107 of file OperationSupport.cpp.
Referenced by mlir::Operation::create(), mlir::Operation::getAttrDictionary(), inferOperationTypes(), mlir::lowerDiscardableAttrsForLLVMFunc(), mlir::detail::Parser::parseAttribute(), parseCommonStructuredOpParts(), parseFunctionArgumentList(), parseTypeAndAttrList(), mlir::function_interface_impl::removeArgAttr(), mlir::Operation::removeAttr(), mlir::Operation::removeDiscardableAttr(), mlir::function_interface_impl::removeResultAttr(), mlir::detail::reportFatalInferReturnTypesError(), mlir::function_interface_impl::setArgAttr(), mlir::Operation::setAttr(), mlir::Operation::setDiscardableAttr(), mlir::spirv::Deserializer::setFunctionArgAttrs(), mlir::OperationName::UnregisteredOpModel::setInherentAttr(), and mlir::function_interface_impl::setResultAttr().
| std::optional< NamedAttribute > NamedAttrList::getNamed | ( | StringAttr | name | ) | const |
Definition at line 145 of file OperationSupport.cpp.
| std::optional< NamedAttribute > NamedAttrList::getNamed | ( | StringRef | name | ) | const |
Return the specified named attribute if present, std::nullopt otherwise.
Definition at line 141 of file OperationSupport.cpp.
| NamedAttrList::operator ArrayRef< NamedAttribute > | ( | ) | const |
Definition at line 210 of file OperationSupport.cpp.
|
inline |
Definition at line 881 of file OperationSupport.h.
References NamedAttrList().
| NamedAttrList & NamedAttrList::operator= | ( | const SmallVectorImpl< NamedAttribute > & | rhs | ) |
Definition at line 205 of file OperationSupport.cpp.
References assign().
|
inline |
Definition at line 884 of file OperationSupport.h.
References NamedAttrList().
|
inline |
Pop last element from list.
Definition at line 940 of file OperationSupport.h.
| void NamedAttrList::push_back | ( | NamedAttribute | newAttribute | ) |
Add an attribute with the specified name.
Definition at line 123 of file OperationSupport.cpp.
Referenced by mlir::detail::Parser::parseAttributeDict(), and mlir::impl::parseOptionalVisibilityKeyword().
Definition at line 934 of file OperationSupport.h.
Referenced by mlirOperationCreate().
If the an attribute exists with the specified name, change it to the new value.
Otherwise, add a new attribute with the specified name/value. Returns the previous attribute value of name, or null if no attribute previously existed with name.
Otherwise, add a new attribute with the specified name/value.
Definition at line 152 of file OperationSupport.cpp.
Referenced by getAttrsForPrinting(), getAttrsForPrinting(), inferAndSetMultiplicandTypes(), mlir::lowerDiscardableAttrsForLLVMFunc(), parseDenseI64ArrayAttr(), set(), mlir::function_interface_impl::setArgAttr(), mlir::Operation::setAttr(), mlir::Operation::setDiscardableAttr(), mlir::spirv::Deserializer::setFunctionArgAttrs(), mlir::OperationName::UnregisteredOpModel::setInherentAttr(), and mlir::function_interface_impl::setResultAttr().
Definition at line 180 of file OperationSupport.cpp.
References mlir::Attribute::getContext(), and set().