|
MLIR 23.0.0git
|
#include <utility>#include "Detail/DimLvlMapParser.h"#include "mlir/Dialect/SparseTensor/IR/Enums.h"#include "mlir/Dialect/SparseTensor/IR/SparseTensor.h"#include "mlir/Dialect/SparseTensor/IR/SparseTensorStorageLayout.h"#include "mlir/Dialect/SparseTensor/IR/SparseTensorType.h"#include "mlir/Dialect/Arith/IR/Arith.h"#include "mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h"#include "mlir/Dialect/Complex/IR/Complex.h"#include "mlir/Dialect/Utils/StaticValueUtils.h"#include "mlir/IR/Builders.h"#include "mlir/IR/DialectImplementation.h"#include "mlir/IR/OpImplementation.h"#include "mlir/IR/PatternMatch.h"#include "llvm/ADT/TypeSwitch.h"#include "llvm/Support/FormatVariadic.h"#include "mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.cpp.inc"#include "mlir/Dialect/SparseTensor/IR/SparseTensorAttrEnums.cpp.inc"#include "mlir/Dialect/SparseTensor/IR/SparseTensorTypes.cpp.inc"#include "mlir/Dialect/SparseTensor/IR/SparseTensorOps.cpp.inc"#include "mlir/Dialect/SparseTensor/IR/SparseTensorOpsDialect.cpp.inc"Go to the source code of this file.
Classes | |
| struct | RemoveUnusedLvlCrds |
Namespaces | |
| namespace | mlir |
| Include the generated interface declarations. | |
| namespace | mlir::sparse_tensor |
Macros | |
| #define | GET_ATTRDEF_CLASSES |
| #define | GET_TYPEDEF_CLASSES |
| #define | GET_ATTRDEF_LIST |
| #define | GET_TYPEDEF_LIST |
| #define | GET_OP_LIST |
| #define | GET_OP_CLASSES |
Functions | |
| static mlir::ParseResult | parseLevelRange (AsmParser &parser, Level &lvlLo, Level &lvlHi) |
| Parses a level range in the form "$lo `to` $hi" or simply "$lo" if $hi - $lo = 1. | |
| static void | printLevelRange (AsmPrinter &p, Level lo, Level hi) |
| Prints a level range in the form "$lo `to` $hi" or simply "$lo" if $hi - $lo = 1. | |
| static llvm::hash_code | mlir::sparse_tensor::hash_value (LevelType lt) |
| static constexpr bool | acceptBitWidth (unsigned bitWidth) |
| static SmallVector< Size > | getSparseFieldShape (const SparseTensorEncodingAttr enc, std::optional< ArrayRef< int64_t > > dimShape) |
| static ParseResult | parseOptionalStaticSlice (int64_t &result, AsmParser &parser) |
| static SparseTensorEncodingAttr | getNormalizedEncodingForSpecifier (SparseTensorEncodingAttr enc) |
| We normalized sparse tensor encoding attribute by always using ordered/unique LT such that "compressed_nu_no" and "compressed_nu" (as well as other variants) lead to the same storage specifier type, and stripping irrelevant fields that do not alter the sparse tensor memory layout. | |
| static LogicalResult | lvlIsInBounds (Level lvl, Value tensor) |
| static LogicalResult | isMatchingWidth (Value mem, unsigned width) |
| static LogicalResult | verifySparsifierGetterSetter (StorageSpecifierKind mdKind, std::optional< Level > lvl, TypedValue< StorageSpecifierType > md, Operation *op) |
| static Type | getFieldElemType (SparseTensorType stt, SparseTensorFieldKind kind) |
| static LogicalResult | verifyPackUnPack (Operation *op, bool requiresStaticShape, SparseTensorType stt, RankedTensorType valTp, TypeRange lvlTps) |
| template<typename ToBufferOp> | |
| static LogicalResult | inferSparseBufferType (ValueRange ops, DictionaryAttr attr, OpaqueProperties prop, RegionRange region, SmallVectorImpl< mlir::Type > &ret) |
| template<typename SpecifierOp> | |
| static SetStorageSpecifierOp | getSpecifierSetDef (SpecifierOp op) |
| template<class T> | |
| static LogicalResult | verifyNumBlockArgs (T *op, Region ®ion, const char *regionName, TypeRange inputTypes, Type outputType) |
| static ParseResult | parseLevelRange (OpAsmParser &parser, IntegerAttr &lvlLoAttr, IntegerAttr &lvlHiAttr) |
| Parses a level range in the form "$lo `to` $hi" or simply "$lo" if $hi - $lo = 1. | |
| static void | printLevelRange (OpAsmPrinter &p, Operation *, IntegerAttr lvlLo, IntegerAttr lvlHi) |
| Prints a level range in the form "$lo `to` $hi" or simply "$lo" if $hi - $lo = 1. | |
| static ParseResult | parseOptionalDefinedList (OpAsmParser &parser, OperationState &state, I64BitSet &definedSet, SmallVectorImpl< OpAsmParser::Argument > &definedArgs, unsigned maxCnt=std::numeric_limits< unsigned >::max(), OpAsmParser::Delimiter delimiter=OpAsmParser::Delimiter::Paren) |
| Parses a list of optional defined list in the form of "(%val0, _, %val1, ...)", where _ is used to annotate that the corresponding value is not defined (e.g., to represent an undefined coordinate in the sparse iteration space). | |
| static void | printOptionalDefinedList (OpAsmPrinter &p, unsigned size, Block::BlockArgListType blocksArgs, I64BitSet definedSet) |
| static ParseResult | parseUsedCoordList (OpAsmParser &parser, OperationState &state, SmallVectorImpl< OpAsmParser::Argument > &coords) |
| static ParseResult | parseSparseIterateLoop (OpAsmParser &parser, OperationState &state, SmallVectorImpl< OpAsmParser::Argument > &iterators, SmallVectorImpl< OpAsmParser::Argument > &blockArgs) |
| static ParseResult | parseSparseCoIterateLoop (OpAsmParser &parser, OperationState &state, SmallVectorImpl< Value > &spacesVals, SmallVectorImpl< OpAsmParser::Argument > &blockArgs) |
| static void | printInitializationList (OpAsmPrinter &p, Block::BlockArgListType blocksArgs, ValueRange initializers, StringRef prefix="") |
| Prints the initialization list in the form of <prefix>(inner = outer, inner2 = outer2, <...>) where 'inner' values are assumed to be region arguments and 'outer' values are regular SSA values. | |
| template<typename SparseLoopOp> | |
| static LogicalResult | verifySparseLoopOp (SparseLoopOp op) |
Variables | |
| static constexpr Level | kInvalidLevel = -1u |
| static constexpr Level | kInvalidFieldIndex = -1u |
| static constexpr FieldIndex | kDataFieldStartingIdx = 0 |
| #define GET_ATTRDEF_CLASSES |
Definition at line 29 of file SparseTensorDialect.cpp.
| #define GET_ATTRDEF_LIST |
| #define GET_OP_CLASSES |
Definition at line 2816 of file SparseTensorDialect.cpp.
| #define GET_OP_LIST |
| #define GET_TYPEDEF_CLASSES |
Definition at line 41 of file SparseTensorDialect.cpp.
| #define GET_TYPEDEF_LIST |
Definition at line 59 of file SparseTensorDialect.cpp.
|
static |
Definition at line 1289 of file SparseTensorDialect.cpp.
References mlir::sparse_tensor::CrdMemRef, mlir::sparse_tensor::SparseTensorType::getCrdType(), mlir::sparse_tensor::SparseTensorType::getElementType(), mlir::sparse_tensor::SparseTensorType::getPosType(), mlir::sparse_tensor::PosMemRef, mlir::sparse_tensor::StorageSpec, and mlir::sparse_tensor::ValMemRef.
Referenced by verifyPackUnPack().
|
static |
We normalized sparse tensor encoding attribute by always using ordered/unique LT such that "compressed_nu_no" and "compressed_nu" (as well as other variants) lead to the same storage specifier type, and stripping irrelevant fields that do not alter the sparse tensor memory layout.
Definition at line 1213 of file SparseTensorDialect.cpp.
References mlir::sparse_tensor::LevelType::stripStorageIrrelevantProperties().
|
static |
Definition at line 73 of file SparseTensorDialect.cpp.
Referenced by mlir::sparse_tensor::foreachFieldAndTypeInSparseTensor().
|
static |
Definition at line 1724 of file SparseTensorDialect.cpp.
|
static |
Definition at line 1607 of file SparseTensorDialect.cpp.
References mlir::sparse_tensor::SparseTensorType::getAoSCOOStart(), mlir::sparse_tensor::SparseTensorType::getBatchLvlShape(), mlir::sparse_tensor::SparseTensorType::getContext(), mlir::sparse_tensor::SparseTensorType::getCrdType(), mlir::sparse_tensor::SparseTensorType::getElementType(), mlir::sparse_tensor::SparseTensorType::getPosType(), mlir::sparse_tensor::getSparseTensorType(), and success().
Definition at line 1253 of file SparseTensorDialect.cpp.
References mlir::sparse_tensor::getMemRefType(), mlir::Type::isIndex(), mlir::Type::isInteger(), and success().
Definition at line 1249 of file SparseTensorDialect.cpp.
References mlir::sparse_tensor::getSparseTensorType(), and success().
|
static |
Parses a level range in the form "$lo `to` $hi" or simply "$lo" if $hi - $lo = 1.
Definition at line 2108 of file SparseTensorDialect.cpp.
References mlir::AsmParser::emitError(), mlir::AsmParser::getNameLoc(), mlir::AsmParser::parseInteger(), mlir::AsmParser::parseOptionalKeyword(), and success().
Referenced by parseLevelRange().
|
static |
Parses a level range in the form "$lo `to` $hi" or simply "$lo" if $hi - $lo = 1.
Definition at line 2129 of file SparseTensorDialect.cpp.
References mlir::AsmParser::getBuilder(), mlir::Builder::getIndexType(), parseLevelRange(), and success().
|
static |
Parses a list of optional defined list in the form of "(%val0, _, %val1, ...)", where _ is used to annotate that the corresponding value is not defined (e.g., to represent an undefined coordinate in the sparse iteration space).
Definition at line 2163 of file SparseTensorDialect.cpp.
References mlir::sparse_tensor::I64BitSet::count(), mlir::AsmParser::emitError(), mlir::AsmParser::getNameLoc(), mlir::AsmParser::Paren, mlir::OpAsmParser::parseArgument(), mlir::AsmParser::parseCommaSeparatedList(), mlir::AsmParser::parseOptionalKeyword(), mlir::sparse_tensor::I64BitSet::set(), and success().
Referenced by parseUsedCoordList().
Definition at line 280 of file SparseTensorDialect.cpp.
References mlir::AsmParser::emitError(), mlir::AsmParser::getCurrentLocation(), mlir::AsmParser::parseOptionalInteger(), mlir::AsmParser::parseQuestion(), and result.
|
static |
Definition at line 2307 of file SparseTensorDialect.cpp.
References mlir::AsmParser::emitError(), mlir::AsmParser::getNameLoc(), mlir::OperationState::operands, mlir::AsmParser::Paren, mlir::AsmParser::parseArrowTypeList(), mlir::OpAsmParser::parseAssignmentList(), mlir::AsmParser::parseColon(), mlir::AsmParser::parseLParen(), mlir::OpAsmParser::parseOperandList(), mlir::AsmParser::parseOptionalKeyword(), mlir::AsmParser::parseRParen(), mlir::AsmParser::parseTypeList(), parseUsedCoordList(), mlir::OpAsmParser::resolveOperand(), mlir::OpAsmParser::resolveOperands(), success(), and mlir::OperationState::types.
|
static |
Definition at line 2232 of file SparseTensorDialect.cpp.
References mlir::AsmParser::emitError(), mlir::AsmParser::getNameLoc(), mlir::OperationState::operands, mlir::OpAsmParser::parseArgumentList(), mlir::AsmParser::parseArrowTypeList(), mlir::OpAsmParser::parseAssignmentList(), mlir::AsmParser::parseColon(), mlir::AsmParser::parseKeyword(), mlir::OpAsmParser::parseOperandList(), mlir::AsmParser::parseOptionalKeyword(), mlir::AsmParser::parseTypeList(), parseUsedCoordList(), mlir::OpAsmParser::resolveOperand(), mlir::OpAsmParser::resolveOperands(), success(), and mlir::OperationState::types.
|
static |
Definition at line 2213 of file SparseTensorDialect.cpp.
References mlir::OperationState::addAttribute(), mlir::AsmParser::getBuilder(), mlir::Builder::getI64IntegerAttr(), mlir::Builder::getIndexType(), parseOptionalDefinedList(), mlir::AsmParser::parseOptionalKeyword(), and success().
Referenced by parseSparseCoIterateLoop(), and parseSparseIterateLoop().
|
static |
Prints the initialization list in the form of <prefix>(inner = outer, inner2 = outer2, <...>) where 'inner' values are assumed to be region arguments and 'outer' values are regular SSA values.
Definition at line 2514 of file SparseTensorDialect.cpp.
|
static |
Prints a level range in the form "$lo `to` $hi" or simply "$lo" if $hi - $lo = 1.
Definition at line 2142 of file SparseTensorDialect.cpp.
Referenced by printLevelRange().
|
static |
Prints a level range in the form "$lo `to` $hi" or simply "$lo" if $hi - $lo = 1.
Definition at line 2152 of file SparseTensorDialect.cpp.
References printLevelRange().
|
static |
Definition at line 2193 of file SparseTensorDialect.cpp.
References mlir::sparse_tensor::I64BitSet::empty().
|
static |
Definition at line 1743 of file SparseTensorDialect.cpp.
References mlir::Region::front(), mlir::Region::getArgument(), mlir::Region::getNumArguments(), mlir::Block::getTerminator(), mlir::Value::getType(), mlir::Block::mightHaveTerminator(), and success().
|
static |
Definition at line 1303 of file SparseTensorDialect.cpp.
References mlir::Operation::emitError(), mlir::sparse_tensor::StorageLayout::foreachField(), mlir::sparse_tensor::SparseTensorType::getAoSCOOStart(), mlir::sparse_tensor::SparseTensorType::getEncoding(), getFieldElemType(), mlir::sparse_tensor::SparseTensorType::getLvlRank(), mlir::sparse_tensor::SparseTensorType::getLvlType(), mlir::sparse_tensor::StorageLayout::getNumDataFields(), mlir::sparse_tensor::SparseTensorType::hasEncoding(), mlir::sparse_tensor::SparseTensorType::hasStaticDimShape(), mlir::sparse_tensor::StorageSpec, success(), and mlir::sparse_tensor::ValMemRef.
|
static |
Definition at line 2531 of file SparseTensorDialect.cpp.
References success().
|
static |
Definition at line 1258 of file SparseTensorDialect.cpp.
References mlir::Operation::emitError(), and success().
|
staticconstexpr |
Definition at line 98 of file SparseTensorDialect.cpp.
Referenced by mlir::sparse_tensor::StorageLayout::foreachField(), and mlir::sparse_tensor::StorageLayout::getNumDataFields().
|
staticconstexpr |
Definition at line 97 of file SparseTensorDialect.cpp.
Referenced by mlir::sparse_tensor::StorageLayout::getFieldIndexAndStride().
|
staticconstexpr |
Definition at line 96 of file SparseTensorDialect.cpp.
Referenced by mlir::sparse_tensor::StorageLayout::foreachField().