#include "mlir/IR/BuiltinTypes.h"
#include "TypeDetail.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/AffineMap.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/BuiltinDialect.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/TensorEncoding.h"
#include "mlir/IR/TypeUtilities.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/Sequence.h"
#include "llvm/ADT/Twine.h"
#include "llvm/ADT/TypeSwitch.h"
usingnamespacemlir;
usingnamespacemlir::detail;
#define GET_TYPEDEF_CLASSES
#include "mlir/IR/BuiltinTypes.cpp.inc"
namespace mlir {
#include "mlir/IR/BuiltinTypeConstraints.cpp.inc"
}
void BuiltinDialect::registerTypes() { … }
LogicalResult ComplexType::verify(function_ref<InFlightDiagnostic()> emitError,
Type elementType) { … }
LogicalResult IntegerType::verify(function_ref<InFlightDiagnostic()> emitError,
unsigned width,
SignednessSemantics signedness) { … }
unsigned IntegerType::getWidth() const { … }
IntegerType::SignednessSemantics IntegerType::getSignedness() const { … }
IntegerType IntegerType::scaleElementBitwidth(unsigned scale) { … }
unsigned FloatType::getWidth() { … }
const llvm::fltSemantics &FloatType::getFloatSemantics() { … }
FloatType FloatType::scaleElementBitwidth(unsigned scale) { … }
unsigned FloatType::getFPMantissaWidth() { … }
unsigned FunctionType::getNumInputs() const { … }
ArrayRef<Type> FunctionType::getInputs() const { … }
unsigned FunctionType::getNumResults() const { … }
ArrayRef<Type> FunctionType::getResults() const { … }
FunctionType FunctionType::clone(TypeRange inputs, TypeRange results) const { … }
FunctionType FunctionType::getWithArgsAndResults(
ArrayRef<unsigned> argIndices, TypeRange argTypes,
ArrayRef<unsigned> resultIndices, TypeRange resultTypes) { … }
FunctionType
FunctionType::getWithoutArgsAndResults(const BitVector &argIndices,
const BitVector &resultIndices) { … }
LogicalResult OpaqueType::verify(function_ref<InFlightDiagnostic()> emitError,
StringAttr dialect, StringRef typeData) { … }
bool VectorType::isValidElementType(Type t) { … }
LogicalResult VectorType::verify(function_ref<InFlightDiagnostic()> emitError,
ArrayRef<int64_t> shape, Type elementType,
ArrayRef<bool> scalableDims) { … }
VectorType VectorType::scaleElementBitwidth(unsigned scale) { … }
VectorType VectorType::cloneWith(std::optional<ArrayRef<int64_t>> shape,
Type elementType) const { … }
Type TensorType::getElementType() const { … }
bool TensorType::hasRank() const { … }
ArrayRef<int64_t> TensorType::getShape() const { … }
TensorType TensorType::cloneWith(std::optional<ArrayRef<int64_t>> shape,
Type elementType) const { … }
RankedTensorType TensorType::clone(::llvm::ArrayRef<int64_t> shape,
Type elementType) const { … }
RankedTensorType TensorType::clone(::llvm::ArrayRef<int64_t> shape) const { … }
static LogicalResult
checkTensorElementType(function_ref<InFlightDiagnostic()> emitError,
Type elementType) { … }
bool TensorType::isValidElementType(Type type) { … }
LogicalResult
RankedTensorType::verify(function_ref<InFlightDiagnostic()> emitError,
ArrayRef<int64_t> shape, Type elementType,
Attribute encoding) { … }
LogicalResult
UnrankedTensorType::verify(function_ref<InFlightDiagnostic()> emitError,
Type elementType) { … }
Type BaseMemRefType::getElementType() const { … }
bool BaseMemRefType::hasRank() const { … }
ArrayRef<int64_t> BaseMemRefType::getShape() const { … }
BaseMemRefType BaseMemRefType::cloneWith(std::optional<ArrayRef<int64_t>> shape,
Type elementType) const { … }
MemRefType BaseMemRefType::clone(::llvm::ArrayRef<int64_t> shape,
Type elementType) const { … }
MemRefType BaseMemRefType::clone(::llvm::ArrayRef<int64_t> shape) const { … }
Attribute BaseMemRefType::getMemorySpace() const { … }
unsigned BaseMemRefType::getMemorySpaceAsInt() const { … }
std::optional<llvm::SmallDenseSet<unsigned>>
mlir::computeRankReductionMask(ArrayRef<int64_t> originalShape,
ArrayRef<int64_t> reducedShape,
bool matchDynamic) { … }
SliceVerificationResult
mlir::isRankReducedType(ShapedType originalType,
ShapedType candidateReducedType) { … }
bool mlir::detail::isSupportedMemorySpace(Attribute memorySpace) { … }
Attribute mlir::detail::wrapIntegerMemorySpace(unsigned memorySpace,
MLIRContext *ctx) { … }
Attribute mlir::detail::skipDefaultMemorySpace(Attribute memorySpace) { … }
unsigned mlir::detail::getMemorySpaceAsInt(Attribute memorySpace) { … }
unsigned MemRefType::getMemorySpaceAsInt() const { … }
MemRefType MemRefType::get(ArrayRef<int64_t> shape, Type elementType,
MemRefLayoutAttrInterface layout,
Attribute memorySpace) { … }
MemRefType MemRefType::getChecked(
function_ref<InFlightDiagnostic()> emitErrorFn, ArrayRef<int64_t> shape,
Type elementType, MemRefLayoutAttrInterface layout, Attribute memorySpace) { … }
MemRefType MemRefType::get(ArrayRef<int64_t> shape, Type elementType,
AffineMap map, Attribute memorySpace) { … }
MemRefType
MemRefType::getChecked(function_ref<InFlightDiagnostic()> emitErrorFn,
ArrayRef<int64_t> shape, Type elementType, AffineMap map,
Attribute memorySpace) { … }
MemRefType MemRefType::get(ArrayRef<int64_t> shape, Type elementType,
AffineMap map, unsigned memorySpaceInd) { … }
MemRefType
MemRefType::getChecked(function_ref<InFlightDiagnostic()> emitErrorFn,
ArrayRef<int64_t> shape, Type elementType, AffineMap map,
unsigned memorySpaceInd) { … }
LogicalResult MemRefType::verify(function_ref<InFlightDiagnostic()> emitError,
ArrayRef<int64_t> shape, Type elementType,
MemRefLayoutAttrInterface layout,
Attribute memorySpace) { … }
unsigned UnrankedMemRefType::getMemorySpaceAsInt() const { … }
LogicalResult
UnrankedMemRefType::verify(function_ref<InFlightDiagnostic()> emitError,
Type elementType, Attribute memorySpace) { … }
static void extractStridesFromTerm(AffineExpr e,
AffineExpr multiplicativeFactor,
MutableArrayRef<AffineExpr> strides,
AffineExpr &offset) { … }
static LogicalResult extractStrides(AffineExpr e,
AffineExpr multiplicativeFactor,
MutableArrayRef<AffineExpr> strides,
AffineExpr &offset) { … }
static LogicalResult getStridesAndOffset(MemRefType t,
SmallVectorImpl<AffineExpr> &strides,
AffineExpr &offset) { … }
LogicalResult mlir::getStridesAndOffset(MemRefType t,
SmallVectorImpl<int64_t> &strides,
int64_t &offset) { … }
std::pair<SmallVector<int64_t>, int64_t>
mlir::getStridesAndOffset(MemRefType t) { … }
ArrayRef<Type> TupleType::getTypes() const { … }
void TupleType::getFlattenedTypes(SmallVectorImpl<Type> &types) { … }
size_t TupleType::size() const { … }
MemRefType mlir::canonicalizeStridedLayout(MemRefType t) { … }
AffineExpr mlir::makeCanonicalStridedLayoutExpr(ArrayRef<int64_t> sizes,
ArrayRef<AffineExpr> exprs,
MLIRContext *context) { … }
AffineExpr mlir::makeCanonicalStridedLayoutExpr(ArrayRef<int64_t> sizes,
MLIRContext *context) { … }
bool mlir::isStrided(MemRefType t) { … }
bool mlir::isLastMemrefDimUnitStride(MemRefType type) { … }
bool mlir::trailingNDimsContiguous(MemRefType type, int64_t n) { … }