|
MLIR 23.0.0git
|
Attribute collections provide a dictionary-like interface. More...
Functions | |
| LogicalResult | verifyHasDefaultDLTIDataLayoutTrait (Operation *op) |
| DataLayoutSpecInterface | getDataLayoutSpec (Operation *op) |
| TargetSystemSpecInterface | getTargetSystemSpec (Operation *op) |
| LogicalResult | foldCastInterfaceOp (Operation *op, ArrayRef< Attribute > attrOperands, SmallVectorImpl< OpFoldResult > &foldResults) |
| Attempt to fold the given cast operation. | |
| LogicalResult | verifyCastInterfaceOp (Operation *op) |
| Attempt to verify the given cast operation. | |
| void | ensureRegionTerminator (Region ®ion, OpBuilder &builder, Location loc, function_ref< Operation *(OpBuilder &, Location)> buildTerminatorOp) |
| Insert an operation, generated by buildTerminatorOp, at the end of the region's only block if it does not have a terminator already. | |
| void | ensureRegionTerminator (Region ®ion, Builder &builder, Location loc, function_ref< Operation *(OpBuilder &, Location)> buildTerminatorOp) |
| Create a simple OpBuilder and forward to the OpBuilder version of this function. | |
| template<typename IteratorT, typename NameT> | |
| std::pair< IteratorT, bool > | findAttrUnsorted (IteratorT first, IteratorT last, NameT name) |
| Unsorted string search or identifier lookups are linear scans. | |
| template<typename IteratorT> | |
| std::pair< IteratorT, bool > | findAttrSorted (IteratorT first, IteratorT last, StringRef name) |
| Using llvm::lower_bound requires an extra string comparison to check whether the returned iterator points to the found element or whether it indicates the lower bound. | |
| template<typename IteratorT> | |
| std::pair< IteratorT, bool > | findAttrSorted (IteratorT first, IteratorT last, StringAttr name) |
| StringAttr lookups on large attribute lists will switch to string binary search. | |
| template<typename IteratorT, typename NameT> | |
| Attribute | getAttrFromSortedRange (IteratorT first, IteratorT last, NameT name) |
| Get an attribute from a sorted range of named attributes. | |
| template<typename IteratorT, typename NameT> | |
| std::optional< NamedAttribute > | getNamedAttrFromSortedRange (IteratorT first, IteratorT last, NameT name) |
| Get an attribute from a sorted range of named attributes. | |
| ParseResult | parseOptionalVisibilityKeyword (OpAsmParser &parser, NamedAttrList &attrs) |
| Parse an optional visibility attribute keyword (i.e., public, private, or nested) without quotes in a string attribute named 'attrName'. | |
| LogicalResult | scalarizeVectorOp (Operation *op, ValueRange operands, ConversionPatternRewriter &rewriter, const LLVMTypeConverter &converter) |
| Unrolls op to array/vector elements. | |
Attribute collections provide a dictionary-like interface.
Define common lookup functions.
| void mlir::impl::ensureRegionTerminator | ( | Region & | region, |
| Builder & | builder, | ||
| Location | loc, | ||
| function_ref< Operation *(OpBuilder &, Location)> | buildTerminatorOp ) |
Create a simple OpBuilder and forward to the OpBuilder version of this function.
Definition at line 1433 of file Operation.cpp.
References ensureRegionTerminator(), and mlir::Builder::getContext().
| void mlir::impl::ensureRegionTerminator | ( | Region & | region, |
| OpBuilder & | builder, | ||
| Location | loc, | ||
| function_ref< Operation *(OpBuilder &, Location)> | buildTerminatorOp ) |
Insert an operation, generated by buildTerminatorOp, at the end of the region's only block if it does not have a terminator already.
If the region is empty, insert a new block first. buildTerminatorOp should return the terminator operation to insert.
Definition at line 1416 of file Operation.cpp.
References mlir::Block::back(), mlir::Region::back(), mlir::OpBuilder::createBlock(), mlir::Block::empty(), mlir::Region::empty(), mlir::Operation::hasTrait(), mlir::OpBuilder::insert(), and mlir::OpBuilder::setInsertionPointToEnd().
Referenced by ensureRegionTerminator(), mlir::OpTrait::SingleBlockImplicitTerminator< TerminatorOpType >::Impl< ConcreteType >::ensureTerminator(), and mlir::OpTrait::SingleBlockImplicitTerminator< TerminatorOpType >::Impl< ConcreteType >::ensureTerminator().
| std::pair< IteratorT, bool > mlir::impl::findAttrSorted | ( | IteratorT | first, |
| IteratorT | last, | ||
| StringAttr | name ) |
StringAttr lookups on large attribute lists will switch to string binary search.
String binary searches become significantly faster than linear scans with the identifier when the attribute list becomes very large.
Definition at line 758 of file OperationSupport.h.
References findAttrSorted(), and findAttrUnsorted().
| std::pair< IteratorT, bool > mlir::impl::findAttrSorted | ( | IteratorT | first, |
| IteratorT | last, | ||
| StringRef | name ) |
Using llvm::lower_bound requires an extra string comparison to check whether the returned iterator points to the found element or whether it indicates the lower bound.
Skip this redundant comparison by checking if compare == / 0 during the binary search.
Definition at line 734 of file OperationSupport.h.
Referenced by findAttrSorted(), getAttrFromSortedRange(), and getNamedAttrFromSortedRange().
| std::pair< IteratorT, bool > mlir::impl::findAttrUnsorted | ( | IteratorT | first, |
| IteratorT | last, | ||
| NameT | name ) |
Unsorted string search or identifier lookups are linear scans.
Definition at line 721 of file OperationSupport.h.
Referenced by findAttrSorted().
| LogicalResult mlir::impl::foldCastInterfaceOp | ( | Operation * | op, |
| ArrayRef< Attribute > | attrOperands, | ||
| SmallVectorImpl< OpFoldResult > & | foldResults ) |
Attempt to fold the given cast operation.
Definition at line 22 of file CastInterfaces.cpp.
References foldCastInterfaceOp(), mlir::Operation::getOperands(), mlir::Operation::getResults(), mlir::OperandRange::getTypes(), mlir::ResultRange::getTypes(), and success().
Referenced by foldCastInterfaceOp().
| Attribute mlir::impl::getAttrFromSortedRange | ( | IteratorT | first, |
| IteratorT | last, | ||
| NameT | name ) |
Get an attribute from a sorted range of named attributes.
Returns null if the attribute was not found.
Definition at line 769 of file OperationSupport.h.
References findAttrSorted(), and result.
| DataLayoutSpecInterface mlir::impl::getDataLayoutSpec | ( | Operation * | op | ) |
Definition at line 26 of file Traits.cpp.
References mlir::Operation::getAttrOfType().
Referenced by mlir::HasDefaultDLTIDataLayout< ConcreteOp >::getDataLayoutSpec().
| std::optional< NamedAttribute > mlir::impl::getNamedAttrFromSortedRange | ( | IteratorT | first, |
| IteratorT | last, | ||
| NameT | name ) |
Get an attribute from a sorted range of named attributes.
Returns std::nullopt if the attribute was not found.
Definition at line 778 of file OperationSupport.h.
References findAttrSorted(), and result.
| TargetSystemSpecInterface mlir::impl::getTargetSystemSpec | ( | Operation * | op | ) |
Definition at line 31 of file Traits.cpp.
References mlir::Operation::getAttrOfType().
Referenced by mlir::HasDefaultDLTIDataLayout< ConcreteOp >::getTargetSystemSpec().
| ParseResult mlir::impl::parseOptionalVisibilityKeyword | ( | OpAsmParser & | parser, |
| NamedAttrList & | attrs ) |
Parse an optional visibility attribute keyword (i.e., public, private, or nested) without quotes in a string attribute named 'attrName'.
Definition at line 1121 of file SymbolTable.cpp.
References mlir::AsmParser::getBuilder(), mlir::Builder::getNamedAttr(), mlir::Builder::getStringAttr(), mlir::SymbolTable::getVisibilityAttrName(), mlir::AsmParser::parseOptionalKeyword(), mlir::NamedAttrList::push_back(), and success().
Referenced by mlir::function_interface_impl::parseFunctionOp().
| LogicalResult mlir::impl::scalarizeVectorOp | ( | Operation * | op, |
| ValueRange | operands, | ||
| ConversionPatternRewriter & | rewriter, | ||
| const LLVMTypeConverter & | converter ) |
Unrolls op to array/vector elements.
Definition at line 649 of file GPUOpsLowering.cpp.
References mlir::Operation::getResultTypes(), mlir::LLVM::detail::handleMultidimensionalVectors(), scalarizeVectorOpHelper(), and success().
Referenced by mlir::ScalarizeVectorOpLowering< SourceOp >::matchAndRewrite().
| LogicalResult mlir::impl::verifyCastInterfaceOp | ( | Operation * | op | ) |
Attempt to verify the given cast operation.
Definition at line 39 of file CastInterfaces.cpp.
References diag(), mlir::Operation::emitOpError(), mlir::Operation::getOperandTypes(), mlir::Operation::getResultTypes(), success(), and verifyCastInterfaceOp().
Referenced by verifyCastInterfaceOp().
| LogicalResult mlir::impl::verifyHasDefaultDLTIDataLayoutTrait | ( | Operation * | op | ) |
Definition at line 15 of file Traits.cpp.
References success().
Referenced by mlir::HasDefaultDLTIDataLayout< ConcreteOp >::verifyTrait().