Home
last modified time | relevance | path

Searched refs:ShapedType (Results 1 – 25 of 146) sorted by relevance

123456

/llvm-project-15.0.7/mlir/lib/Dialect/Tosa/IR/
H A DTosaOps.cpp595 if (dim != ShapedType::kDynamicSize) in inferReturnTypeComponents()
628 if (val != ShapedType::kDynamicSize) { in inferReturnTypeComponents()
635 if (val == ShapedType::kDynamicSize) in inferReturnTypeComponents()
1058 if (!ShapedType::isDynamic(inputHeight) && in inferReturnTypeComponents()
1066 if (!ShapedType::isDynamic(inputWidth) && in inferReturnTypeComponents()
1067 !ShapedType::isDynamic(weightWidth)) { in inferReturnTypeComponents()
1128 if (!ShapedType::isDynamic(inputHeight) && in inferReturnTypeComponents()
1136 if (!ShapedType::isDynamic(inputWidth) && in inferReturnTypeComponents()
1144 if (!ShapedType::isDynamic(inputDepth) && in inferReturnTypeComponents()
1238 if (!ShapedType::isDynamic(inputWidth) && in inferReturnTypeComponents()
[all …]
/llvm-project-15.0.7/mlir/unittests/IR/
H A DShapedTypeTest.cpp32 ShapedType memrefType = in TEST()
33 (ShapedType)MemRefType::Builder(memrefOriginalShape, memrefOriginalType) in TEST()
40 (ShapedType)MemRefType::Builder(memrefNewShape, memrefOriginalType) in TEST()
57 ShapedType unrankedTensorType = in TEST()
79 ShapedType tensorType = in TEST()
86 (ShapedType)RankedTensorType::get(tensorNewShape, tensorOriginalType)); in TEST()
92 (ShapedType)RankedTensorType::get(tensorOriginalShape, tensorNewType)); in TEST()
101 (ShapedType)RankedTensorType::get(tensorNewShape, tensorOriginalType)); in TEST()
103 (ShapedType)UnrankedTensorType::get(tensorNewType)); in TEST()
106 (ShapedType)RankedTensorType::get(tensorNewShape, tensorOriginalType)); in TEST()
[all …]
/llvm-project-15.0.7/mlir/lib/IR/
H A DBuiltinAttributeInterfaces.cpp27 ShapedType ElementsAttr::getType() const { in getType()
28 return Attribute::getType().cast<ShapedType>(); in getType()
32 return elementsAttr.getType().cast<ShapedType>().getElementType(); in getElementType()
36 return elementsAttr.getType().cast<ShapedType>().getNumElements(); in getNumElements()
39 bool ElementsAttr::isValidIndex(ShapedType type, ArrayRef<uint64_t> index) { in isValidIndex()
56 return isValidIndex(elementsAttr.getType().cast<ShapedType>(), index); in isValidIndex()
60 ShapedType shapeType = type.cast<ShapedType>(); in getFlattenedIndex()
H A DTypeUtilities.cpp25 if (auto st = type.dyn_cast<ShapedType>()) in getElementTypeOrSelf()
64 if (!ShapedType::isDynamic(dim1) && !ShapedType::isDynamic(dim2) && in verifyCompatibleShape()
77 auto sType1 = type1.dyn_cast<ShapedType>(); in verifyCompatibleShape()
78 auto sType2 = type2.dyn_cast<ShapedType>(); in verifyCompatibleShape()
108 return ShapedType::isDynamic(dim) ? fold : dim; in verifyCompatibleDims()
111 return ShapedType::isDynamic(dim) || dim == staticDim; in verifyCompatibleDims()
121 types, [](auto type) { return type.template dyn_cast<ShapedType>(); })); in verifyCompatibleShapes()
168 return value.getType().cast<ShapedType>().getElementType(); in mapElement()
172 return value.getType().cast<ShapedType>().getElementType(); in mapElement()
H A DBuiltinTypeInterfaces.cpp26 constexpr int64_t ShapedType::kDynamicSize;
27 constexpr int64_t ShapedType::kDynamicStrideOrOffset;
29 int64_t ShapedType::getNumElements(ArrayRef<int64_t> shape) { in getNumElements()
38 int64_t ShapedType::getSizeInBits() const { in getSizeInBits()
50 return getNumElements() * elementType.cast<ShapedType>().getSizeInBits(); in getSizeInBits()
H A DAttributeDetail.h46 DenseElementsAttributeStorage(ShapedType ty, bool isSplat) in DenseElementsAttributeStorage()
54 DenseIntOrFPElementsAttrStorage(ShapedType ty, ArrayRef<char> data,
59 KeyTy(ShapedType type, ArrayRef<char> data, llvm::hash_code hashCode,
64 ShapedType type;
100 static KeyTy getKey(ShapedType ty, ArrayRef<char> data, bool isKnownSplat) { in getKey()
141 static KeyTy getKeyForBoolData(ShapedType ty, ArrayRef<char> data, in getKeyForBoolData()
207 DenseStringElementsAttrStorage(ShapedType ty, ArrayRef<StringRef> data,
212 KeyTy(ShapedType type, ArrayRef<StringRef> data, llvm::hash_code hashCode,
217 ShapedType type;
243 static KeyTy getKey(ShapedType ty, ArrayRef<StringRef> data, in getKey()
H A DBuiltinAttributes.cpp693 DenseArrayBaseAttrStorage(ShapedType type, in DenseArrayBaseAttrStorage()
1082 DenseElementsAttr::get(ShapedType type, in get()
1277 ShapedType curType = getType(); in reshape()
1291 ShapedType curType = getType(); in resizeSplat()
1305 ShapedType curType = getType(); in bitcast()
1328 ShapedType DenseElementsAttr::getType() const { in getType()
1476 ShapedType type) { in convertEndianOfArrayRefForBEmachine()
1498 static ShapedType mappingHelper(Fn mapping, Attr &attr, ShapedType inType, in mappingHelper()
1504 ShapedType newArrayType; in mappingHelper()
1588 ShapedType type) { in verify()
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/Tosa/Transforms/
H A DTosaDecomposeTransposeConv.cpp93 ShapedType inputTy = input.getType().cast<ShapedType>(); in matchAndRewrite()
94 ShapedType weightTy = weight.getType().cast<ShapedType>(); in matchAndRewrite()
95 ShapedType biasTy = bias.getType().cast<ShapedType>(); in matchAndRewrite()
96 ShapedType resultTy = op->getResult(0).getType().cast<ShapedType>(); in matchAndRewrite()
157 ShapedType inputTy = input.getType().cast<ShapedType>(); in matchAndRewrite()
158 ShapedType weightTy = weight.getType().cast<ShapedType>(); in matchAndRewrite()
159 ShapedType biasTy = bias.getType().cast<ShapedType>(); in matchAndRewrite()
160 ShapedType resultTy = op->getResult(0).getType().cast<ShapedType>(); in matchAndRewrite()
216 weightTy = weight.getType().cast<ShapedType>(); in matchAndRewrite()
245 ShapedType restridedWeightTy = weight.getType().cast<ShapedType>(); in matchAndRewrite()
[all …]
H A DTosaDecomposeConv2D.cpp30 ShapedType inputType = input.getType().cast<ShapedType>(); in matchAndRewrite()
31 ShapedType weightType = weight.getType().cast<ShapedType>(); in matchAndRewrite()
32 ShapedType resultType = op.getType().cast<ShapedType>(); in matchAndRewrite()
35 llvm::count_if(inputType.getShape(), ShapedType::isDynamic); in matchAndRewrite()
57 combined = ShapedType::kDynamicSize; in matchAndRewrite()
H A DTosaDecomposeDepthwise.cpp31 ShapedType inputType = input.getType().cast<ShapedType>(); in matchAndRewrite()
32 ShapedType weightType = weight.getType().cast<ShapedType>(); in matchAndRewrite()
33 ShapedType resultType = op.getOutput().getType().cast<ShapedType>(); in matchAndRewrite()
98 auto outputShape = op.getOutput().getType().cast<ShapedType>().getShape(); in matchAndRewrite()
/llvm-project-15.0.7/mlir/lib/Interfaces/
H A DInferTypeOpInterface.cpp29 return t.cast<ShapedType>().hasRank(); in hasRank()
39 return t.cast<ShapedType>().getElementType(); in getElementType()
48 ArrayRef<int64_t> vals = t.cast<ShapedType>().getShape(); in getDims()
71 return t.cast<ShapedType>().getDimSize(index); in getDimSize()
83 return t.cast<ShapedType>().getRank(); in getRank()
94 return t.cast<ShapedType>().hasStaticShape(); in hasStaticShape()
98 if (ShapedType::isDynamic(index.getSExtValue())) in hasStaticShape()
103 return llvm::none_of(stc->getDims(), ShapedType::isDynamic); in hasStaticShape()
110 return t.cast<ShapedType>().getNumElements(); in getNumElements()
140 if (ShapedType::isDynamic(dim)) in dump()
H A DViewLikeInterface.cpp60 ShapedType::isDynamicStrideOrOffset))) in verifyOffsetSizeAndStrideOp()
64 ShapedType::isDynamic))) in verifyOffsetSizeAndStrideOp()
68 ShapedType::isDynamicStrideOrOffset))) in verifyOffsetSizeAndStrideOp()
96 return printOperandsOrIntegersListImpl<ShapedType::kDynamicStrideOrOffset>( in printOperandsOrIntegersOffsetsOrStridesList()
103 return printOperandsOrIntegersListImpl<ShapedType::kDynamicSize>(p, values, in printOperandsOrIntegersSizesList()
149 return parseOperandsOrIntegersImpl<ShapedType::kDynamicStrideOrOffset>( in parseOperandsOrIntegersOffsetsOrStridesList()
157 return parseOperandsOrIntegersImpl<ShapedType::kDynamicSize>(parser, values, in parseOperandsOrIntegersSizesList()
237 staticValues.push_back(ShapedType::kDynamicStrideOrOffset); in decomposeMixedImpl()
246 return decomposeMixedImpl(b, mixedValues, ShapedType::kDynamicStrideOrOffset); in decomposeMixedStridesOrOffsets()
252 return decomposeMixedImpl(b, mixedValues, ShapedType::kDynamicSize); in decomposeMixedSizes()
/llvm-project-15.0.7/mlir/lib/Conversion/TosaToLinalg/
H A DTosaToLinalgNamed.cpp39 ShapedType inputTy = input.getType().cast<ShapedType>(); in applyPad()
104 ShapedType inputTy = input.getType().cast<ShapedType>(); in inferDynamicDimsForConv()
173 ShapedType inputTy = input.getType().cast<ShapedType>(); in matchAndRewrite()
174 ShapedType weightTy = weight.getType().cast<ShapedType>(); in matchAndRewrite()
175 ShapedType biasTy = bias.getType().cast<ShapedType>(); in matchAndRewrite()
341 ShapedType inputTy = input.getType().cast<ShapedType>(); in matchAndRewrite()
342 ShapedType weightTy = weight.getType().cast<ShapedType>(); in matchAndRewrite()
343 ShapedType biasTy = bias.getType().cast<ShapedType>(); in matchAndRewrite()
690 ShapedType inputTy = input.getType().cast<ShapedType>(); in matchAndRewrite()
692 ShapedType resultTy = op.getType().template cast<ShapedType>(); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/Tosa/Utils/
H A DQuantUtils.cpp119 auto inputType = input.getType().dyn_cast<ShapedType>(); in buildConvOpQuantizationAttr()
120 auto weightType = weight.getType().dyn_cast<ShapedType>(); in buildConvOpQuantizationAttr()
163 auto aType = a.getType().dyn_cast<ShapedType>(); in buildMatMulOpQuantizationAttr()
164 auto bType = b.getType().dyn_cast<ShapedType>(); in buildMatMulOpQuantizationAttr()
192 auto inputType = input.getType().dyn_cast<ShapedType>(); in buildUnaryOpQuantizationAttr()
193 auto outputType = outputRawType.dyn_cast<ShapedType>(); in buildUnaryOpQuantizationAttr()
218 auto inputType = input.getType().dyn_cast<ShapedType>(); in buildPadOpQuantizationAttr()
238 auto inputType = input.getType().dyn_cast<ShapedType>(); in buildConvOpResultTypeInfo()
239 auto weightType = weight.getType().dyn_cast<ShapedType>(); in buildConvOpResultTypeInfo()
253 auto outputShapedType = outputType.dyn_cast<ShapedType>(); in buildConvOpResultTypeInfo()
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/Quant/IR/
H A DQuantTypes.cpp86 if (candidateExpressedType.isa<ShapedType>()) { in isCompatibleExpressedType()
87 return candidateExpressedType.cast<ShapedType>().getElementType() == in isCompatibleExpressedType()
95 if (primitiveOrContainerType.isa<ShapedType>()) { in getQuantizedElementType()
97 primitiveOrContainerType.cast<ShapedType>().getElementType(); in getQuantizedElementType()
131 if (quantizedType.isa<ShapedType>()) { in castToStorageType()
133 ShapedType sType = quantizedType.cast<ShapedType>(); in castToStorageType()
158 if (candidateType.isa<ShapedType>()) { in castFromExpressedType()
159 ShapedType candidateShapedType = candidateType.cast<ShapedType>(); in castFromExpressedType()
186 if (quantizedType.isa<ShapedType>()) { in castToExpressedType()
188 ShapedType sType = quantizedType.cast<ShapedType>(); in castToExpressedType()
/llvm-project-15.0.7/mlir/lib/Dialect/Utils/
H A DReshapeOpsUtils.cpp19 mlir::getReassociationIndicesForReshape(ShapedType sourceType, in getReassociationIndicesForReshape()
20 ShapedType targetType) { in getReassociationIndicesForReshape()
49 while (sourceShape[sourceDim] != ShapedType::kDynamicSize && in getReassociationIndicesForCollapse()
59 if (sourceShape[sourceDim] == ShapedType::kDynamicSize && in getReassociationIndicesForCollapse()
60 (currTargetShape != ShapedType::kDynamicSize || in getReassociationIndicesForCollapse()
66 if (currTargetShape == ShapedType::kDynamicSize && in getReassociationIndicesForCollapse()
67 sourceShape[sourceDim] != ShapedType::kDynamicSize) in getReassociationIndicesForCollapse()
86 if (sourceShape[sourceDim] != ShapedType::kDynamicSize && in getReassociationIndicesForCollapse()
236 if (ShapedType::isDynamic(dim.value())) { in reshapeLikeShapesAreCompatible()
250 if (!ShapedType::isDynamic(collapsedShape[map.index()])) { in reshapeLikeShapesAreCompatible()
/llvm-project-15.0.7/mlir/lib/Dialect/Tensor/IR/
H A DTensorOps.cpp63 if (!ShapedType::isDynamic(std::get<0>(t)) && in preservesStaticInformation()
64 ShapedType::isDynamic(std::get<1>(t))) in preservesStaticInformation()
268 if (ShapedType::isDynamic(dim)) in matchAndRewrite()
354 if (ShapedType::isDynamic(dim)) in fold()
642 if (!ShapedType::isDynamic(dim)) { in matchAndRewrite()
743 auto shapedType = type.dyn_cast<ShapedType>(); in fold()
780 if (ShapedType::isDynamic(shapeSize)) in verify()
827 size = ShapedType::kDynamicSize; in computeTensorReshapeCollapsedType()
1493 verifyInsertSliceOp(ShapedType srcType, ShapedType dstType, in verifyInsertSliceOp()
1509 ShapedType expectedType; in verify()
[all …]
/llvm-project-15.0.7/mlir/include/mlir/Dialect/Utils/
H A DReshapeOpsUtils.h69 getReassociationIndicesForReshape(ShapedType sourceType, ShapedType targetType);
95 reshapeOp.getResult().getType().template cast<ShapedType>()); in foldReshapeOp()
156 static LogicalResult verifyReshapeLikeShapes(OpTy op, ShapedType collapsedType, in verifyReshapeLikeShapes()
157 ShapedType expandedType, in verifyReshapeLikeShapes()
180 ShapedType resultType = reshapeOp.getResultType(); in matchAndRewrite()
236 ShapedType srcType = expandOp.getSrcType(); in matchAndRewrite()
237 ShapedType resultType = collapseOp.getResultType(); in matchAndRewrite()
295 ShapedType srcType = collapseOp.getSrcType(); in matchAndRewrite()
296 ShapedType resultType = expandOp.getResultType(); in matchAndRewrite()
/llvm-project-15.0.7/mlir/lib/CAPI/IR/
H A DBuiltinAttributes.cpp339 DenseElementsAttr::get(unwrap(shapedType).cast<ShapedType>(), in mlirDenseElementsAttrGet()
346 auto shapedTypeCpp = unwrap(shapedType).cast<ShapedType>(); in mlirDenseElementsAttrRawBufferGet()
358 return wrap(DenseElementsAttr::get(unwrap(shapedType).cast<ShapedType>(), in mlirDenseElementsAttrSplatGet()
364 DenseElementsAttr::get(unwrap(shapedType).cast<ShapedType>(), element)); in mlirDenseElementsAttrBoolSplatGet()
369 DenseElementsAttr::get(unwrap(shapedType).cast<ShapedType>(), element)); in mlirDenseElementsAttrUInt8SplatGet()
374 DenseElementsAttr::get(unwrap(shapedType).cast<ShapedType>(), element)); in mlirDenseElementsAttrInt8SplatGet()
412 DenseElementsAttr::get(unwrap(shapedType).cast<ShapedType>(), values)); in mlirDenseElementsAttrBoolGet()
421 DenseElementsAttr::get(unwrap(shapedType).cast<ShapedType>(), in getDenseAttribute()
499 DenseElementsAttr::get(unwrap(shapedType).cast<ShapedType>(), values)); in mlirDenseElementsAttrStringGet()
505 unwrap(shapedType).cast<ShapedType>())); in mlirDenseElementsAttrReshapeGet()
[all …]
H A DBuiltinTypes.cpp125 bool mlirTypeIsAShaped(MlirType type) { return unwrap(type).isa<ShapedType>(); } in mlirTypeIsAShaped()
128 return wrap(unwrap(type).cast<ShapedType>().getElementType()); in mlirShapedTypeGetElementType()
132 return unwrap(type).cast<ShapedType>().hasRank(); in mlirShapedTypeHasRank()
136 return unwrap(type).cast<ShapedType>().getRank(); in mlirShapedTypeGetRank()
140 return unwrap(type).cast<ShapedType>().hasStaticShape(); in mlirShapedTypeHasStaticShape()
144 return unwrap(type).cast<ShapedType>().isDynamicDim( in mlirShapedTypeIsDynamicDim()
149 return unwrap(type).cast<ShapedType>().getDimSize(static_cast<unsigned>(dim)); in mlirShapedTypeGetDimSize()
152 int64_t mlirShapedTypeGetDynamicSize() { return ShapedType::kDynamicSize; } in mlirShapedTypeGetDynamicSize()
155 return ShapedType::isDynamic(size); in mlirShapedTypeIsDynamicSize()
159 return ShapedType::isDynamicStrideOrOffset(val); in mlirShapedTypeIsDynamicStrideOrOffset()
[all …]
/llvm-project-15.0.7/mlir/include/mlir/IR/
H A DBuiltinAttributes.h28 class ShapedType; variable
160 static DenseElementsAttr get(ShapedType type,
173 static DenseElementsAttr get(ShapedType type,
180 static DenseElementsAttr get(const ShapedType &type,
198 static DenseElementsAttr getFromRawBuffer(ShapedType type,
632 ShapedType getType() const;
653 DenseElementsAttr reshape(ShapedType newType);
658 DenseElementsAttr resizeSplat(ShapedType newType);
709 static DenseElementsAttr getRawIntOrFloat(ShapedType type,
883 static DenseFPElementsAttr get(const ShapedType &type,
[all …]
H A DBuiltinTypes.h77 class TensorType : public Type, public ShapedType::Trait<TensorType> {
102 operator ShapedType() const { return cast<ShapedType>(); } in ShapedType() function
113 class BaseMemRefType : public Type, public ShapedType::Trait<BaseMemRefType> {
145 operator ShapedType() const { return cast<ShapedType>(); } in ShapedType() function
362 SliceVerificationResult isRankReducedType(ShapedType originalType,
363 ShapedType candidateReducedType);
/llvm-project-15.0.7/mlir/include/mlir/Dialect/Tosa/Utils/
H A DCoversionUtils.h57 SmallVector<ShapedType> dynTypes; in checkHasDynamicBatchDims()
60 auto paramTy = param.getType().cast<ShapedType>(); in checkHasDynamicBatchDims()
68 for (const ShapedType &dynTy : dynTypes) { in checkHasDynamicBatchDims()
69 if (llvm::any_of(dynTy.getShape().drop_front(), ShapedType::isDynamic)) { in checkHasDynamicBatchDims()
H A DShapeUtils.h47 if (auto shapedType = type.dyn_cast<ShapedType>()) { in getKnowledgeFromType()
114 result.sizes.resize(lhs.sizes.size(), ShapedType::kDynamicSize); in join()
119 if (lhsSize == ShapedType::kDynamicSize) { in join()
121 } else if (rhsSize == ShapedType::kDynamicSize) { in join()
158 result.sizes.resize(lhs.sizes.size(), ShapedType::kDynamicSize); in meet()
/llvm-project-15.0.7/mlir/lib/Dialect/Quant/Utils/
H A DQuantizeUtils.cpp56 ShapedType newDenseType = in convertDenseFPElementsAttr()
59 .dyn_cast_or_null<ShapedType>(); in convertDenseFPElementsAttr()
86 ShapedType newSparseType = in convertSparseElementsAttr()
88 .dyn_cast_or_null<ShapedType>(); in convertSparseElementsAttr()

123456