| /llvm-project-15.0.7/mlir/lib/Conversion/BufferizationToMemRef/ |
| H A D | BufferizationToMemRef.cpp | 42 MemRefType memrefType = type.cast<MemRefType>(); in matchAndRewrite() local 45 MemRefType::get(memrefType.getShape(), memrefType.getElementType(), in matchAndRewrite() 46 layout, memrefType.getMemorySpace()); in matchAndRewrite() 49 if (!memref::CastOp::areCastCompatible({allocType}, {memrefType})) in matchAndRewrite() 56 for (int i = 0; i < memrefType.getRank(); ++i) { in matchAndRewrite() 57 if (!memrefType.isDynamicDim(i)) in matchAndRewrite() 69 if (memrefType != allocType) in matchAndRewrite() 70 alloc = rewriter.create<memref::CastOp>(op->getLoc(), memrefType, alloc); in matchAndRewrite()
|
| /llvm-project-15.0.7/mlir/lib/Dialect/MemRef/Transforms/ |
| H A D | NormalizeMemRefs.cpp | 216 MemRefType memrefType = opType.dyn_cast<MemRefType>(); in updateFunctionSignature() local 219 if (!memrefType || memrefType == resultTypes[operandEn.index()]) in updateFunctionSignature() 229 if (memrefType.getLayout().isIdentity()) in updateFunctionSignature() 230 resultTypes[operandEn.index()] = memrefType; in updateFunctionSignature() 347 MemRefType memrefType = argType.dyn_cast<MemRefType>(); in normalizeFuncOpMemRefs() local 350 if (!memrefType) { in normalizeFuncOpMemRefs() 358 if (newMemRefType == memrefType || funcOp.isExternal()) { in normalizeFuncOpMemRefs() 458 if (!memrefType) { in normalizeFuncOpMemRefs() 498 if (!memrefType) { in createOpResultsNormalized() 505 if (newMemRefType == memrefType) { in createOpResultsNormalized() [all …]
|
| /llvm-project-15.0.7/mlir/lib/Dialect/Bufferization/Transforms/ |
| H A D | BufferResultsToOutParams.cpp | 49 if (auto memrefType = resultType.value().dyn_cast<MemRefType>()) { in updateFuncOp() local 50 if (!hasStaticIdentityLayout(memrefType) && in updateFuncOp() 51 !hasFullyDynamicLayoutMap(memrefType)) { in updateFuncOp() 59 erasedResultTypes.push_back(memrefType); in updateFuncOp() 135 auto memrefType = memref.getType().cast<MemRefType>(); in updateCalls() local 137 MemRefType::get(memrefType.getShape(), memrefType.getElementType(), in updateCalls() 138 AffineMap(), memrefType.getMemorySpaceAsInt()); in updateCalls() 140 if (!hasStaticIdentityLayout(memrefType)) { in updateCalls() 142 assert(hasFullyDynamicLayoutMap(memrefType) && in updateCalls() 145 builder.create<memref::CastOp>(op.getLoc(), memrefType, outParam); in updateCalls()
|
| H A D | FuncBufferizableOpInterfaceImpl.cpp | 70 BaseMemRefType memrefType; in getBufferizedFunctionArgType() local 73 memrefType = getMemRefTypeWithStaticIdentityLayout(tensorType); in getBufferizedFunctionArgType() 77 memrefType = getMemRefTypeWithFullyDynamicLayout(tensorType); in getBufferizedFunctionArgType() 83 return memrefType; in getBufferizedFunctionArgType() 85 auto rankedMemrefType = memrefType.dyn_cast<MemRefType>(); in getBufferizedFunctionArgType() 443 Type memrefType = in bufferize() local 445 bbArg.setType(memrefType); in bufferize()
|
| /llvm-project-15.0.7/mlir/lib/Conversion/MemRefToSPIRV/ |
| H A D | MemRefToSPIRV.cpp | 321 auto memrefType = loadOp.getMemref().getType().cast<MemRefType>(); in matchAndRewrite() local 322 if (!memrefType.getElementType().isSignlessInteger()) in matchAndRewrite() 333 int srcBits = memrefType.getElementType().getIntOrFloatBitWidth(); in matchAndRewrite() 337 Type pointeeType = typeConverter.convertType(memrefType) in matchAndRewrite() 416 auto memrefType = loadOp.getMemref().getType().cast<MemRefType>(); in matchAndRewrite() local 417 if (memrefType.getElementType().isSignlessInteger()) in matchAndRewrite() 434 if (!memrefType.getElementType().isSignlessInteger()) in matchAndRewrite() 446 int srcBits = memrefType.getElementType().getIntOrFloatBitWidth(); in matchAndRewrite() 452 Type pointeeType = typeConverter.convertType(memrefType) in matchAndRewrite() 503 Optional<spirv::Scope> scope = getAtomicOpScope(memrefType); in matchAndRewrite() [all …]
|
| /llvm-project-15.0.7/mlir/lib/Conversion/LinalgToStandard/ |
| H A D | LinalgToStandard.cpp | 34 if (auto memrefType = type.dyn_cast<MemRefType>()) in extractOperandTypes() local 35 result.push_back(eraseStridedLayout(memrefType)); in extractOperandTypes() 87 auto memrefType = op.getType().dyn_cast<MemRefType>(); in createTypeCanonicalizedMemRefOperands() local 88 if (!memrefType) { in createTypeCanonicalizedMemRefOperands() 93 b.create<memref::CastOp>(loc, eraseStridedLayout(memrefType), op); in createTypeCanonicalizedMemRefOperands()
|
| /llvm-project-15.0.7/mlir/test/lib/Analysis/ |
| H A D | TestMemRefStrideCalculation.cpp | 35 auto memrefType = allocOp.getResult().getType().cast<MemRefType>(); in runOnOperation() local 38 if (failed(getStridesAndOffset(memrefType, strides, offset))) { in runOnOperation() 39 llvm::outs() << "MemRefType " << memrefType << " cannot be converted to " in runOnOperation()
|
| /llvm-project-15.0.7/mlir/unittests/IR/ |
| H A D | ShapedTypeTest.cpp | 32 ShapedType memrefType = in TEST() local 39 ASSERT_EQ(memrefType.clone(memrefNewShape), in TEST() 46 ASSERT_EQ(memrefType.clone(memrefNewType), in TEST() 51 ASSERT_EQ(memrefType.clone(memrefNewShape, memrefNewType), in TEST()
|
| /llvm-project-15.0.7/mlir/lib/Dialect/MemRef/IR/ |
| H A D | MemRefOps.cpp | 166 auto memrefType = alloc.getType(); in matchAndRewrite() local 767 if (*index >= memrefType.getRank()) in verify() 881 if (!memrefType) in fold() 1209 Type memrefType; in parse() local 1215 parser.parseColonType(memrefType) || in parse() 1273 if (!memrefType || !memrefType.hasStaticShape()) in parseGlobalMemrefOpTypeAndInitialValue() 1297 if (!memrefType || !memrefType.hasStaticShape()) in verify() 2359 << memrefType.getElementType(); in produceSubViewErrorMsg() 2766 auto memrefType = viewOp.getType(); in matchAndRewrite() local 2784 unsigned rank = memrefType.getRank(); in matchAndRewrite() [all …]
|
| /llvm-project-15.0.7/mlir/lib/Conversion/AMDGPUToROCDL/ |
| H A D | AMDGPUToROCDL.cpp | 42 MemRefType memrefType = unconvertedMemref.getType().cast<MemRefType>(); in matchAndRewrite() local 61 int64_t elementByteWidth = memrefType.getElementTypeBitWidth() / 8; in matchAndRewrite() 106 if (failed(getStridesAndOffset(memrefType, strides, offset))) in matchAndRewrite() 137 if (memrefType.hasStaticShape()) { in matchAndRewrite() 140 static_cast<int32_t>(memrefType.getNumElements() * elementByteWidth)); in matchAndRewrite() 143 for (uint32_t i = 0, e = memrefType.getRank(); i < e; ++i) { in matchAndRewrite()
|
| /llvm-project-15.0.7/mlir/lib/Dialect/Affine/Utils/ |
| H A D | Utils.cpp | 1678 MemRefType memrefType = allocOp->getType(); in normalizeMemRef() local 1685 if (newMemRefType == memrefType) in normalizeMemRef() 1737 unsigned rank = memrefType.getRank(); in normalizeMemRefType() 1739 return memrefType; in normalizeMemRefType() 1741 if (memrefType.getLayout().isIdentity()) { in normalizeMemRefType() 1744 return memrefType; in normalizeMemRefType() 1757 return memrefType; in normalizeMemRefType() 1761 ArrayRef<int64_t> shape = memrefType.getShape(); in normalizeMemRefType() 1778 return memrefType; in normalizeMemRefType() 1797 return memrefType; in normalizeMemRefType() [all …]
|
| /llvm-project-15.0.7/mlir/lib/Dialect/Affine/IR/ |
| H A D | AffineOps.cpp | 2563 int64_t rank = memrefType.getRank(); in build() 2632 auto memrefType = getMemRefType(); in verify() local 2639 getMapOperands(), memrefType, in verify() 2705 int64_t rank = memrefType.getRank(); in build() 2748 auto memrefType = getMemRefType(); in verify() local 2756 getMapOperands(), memrefType, in verify() 3875 int64_t rank = memrefType.getRank(); in build() 3893 MemRefType memrefType; in parse() local 3937 getMapOperands(), memrefType, in verify() 3966 int64_t rank = memrefType.getRank(); in build() [all …]
|
| /llvm-project-15.0.7/mlir/lib/Dialect/Tensor/Transforms/ |
| H A D | BufferizableOpInterfaceImpl.cpp | 162 auto memrefType = in bufferize() local 167 op->getLoc(), memrefType, *tensorAlloc); in bufferize() 393 auto memrefType = in bufferize() local 396 op->getLoc(), memrefType, *tensorAlloc); in bufferize() 461 auto memrefType = in bufferize() local 464 op->getLoc(), memrefType, *tensorAlloc); in bufferize() 467 int64_t rank = memrefType.getRank(); in bufferize() 476 memrefType.isDynamicDim(i) in bufferize() 479 loc, memrefType.getDimSize(i)); in bufferize()
|
| /llvm-project-15.0.7/mlir/lib/IR/ |
| H A D | BuiltinTypes.cpp | 1060 static AffineExpr getOffsetExpr(MemRefType memrefType) { in getOffsetExpr() argument 1063 if (failed(getStridesAndOffset(memrefType, strides, offset))) in getOffsetExpr() 1084 bool mlir::isStaticShapeAndContiguousRowMajor(MemRefType memrefType) { in isStaticShapeAndContiguousRowMajor() argument 1085 if (!memrefType.hasStaticShape()) in isStaticShapeAndContiguousRowMajor() 1087 AffineExpr offset = getOffsetExpr(memrefType); in isStaticShapeAndContiguousRowMajor() 1089 memrefType.getContext(), memrefType.getShape(), in isStaticShapeAndContiguousRowMajor() 1090 memrefType.getElementType(), offset); in isStaticShapeAndContiguousRowMajor() 1091 return canonicalizeStridedLayout(memrefType) == in isStaticShapeAndContiguousRowMajor()
|
| /llvm-project-15.0.7/mlir/lib/Dialect/Bufferization/IR/ |
| H A D | BufferizableOpInterface.cpp | 539 static void ensureToMemrefOpIsValid(Value tensor, Type memrefType) { in ensureToMemrefOpIsValid() argument 542 assert((!rankedTensorType || memrefType.cast<MemRefType>().getRank() == in ensureToMemrefOpIsValid() 562 FailureOr<BaseMemRefType> memrefType = getBufferType(value, options); in getBuffer() local 563 if (failed(memrefType)) in getBuffer() 565 ensureToMemrefOpIsValid(value, *memrefType); in getBuffer() 567 .create<bufferization::ToMemrefOp>(value.getLoc(), *memrefType, value) in getBuffer()
|
| H A D | BufferizationOps.cpp | 591 auto memrefType = MemRefType::get(srcTensorType.getShape(), in matchAndRewrite() local 593 Value memref = rewriter.create<ToMemrefOp>(toMemref.getLoc(), memrefType, in matchAndRewrite()
|
| /llvm-project-15.0.7/mlir/test/lib/Dialect/Vector/ |
| H A D | TestVectorTransforms.cpp | 767 MemRefType memrefType; in allocateGlobalSharedMemory() local 769 memrefType = in allocateGlobalSharedMemory() 773 memrefType = MemRefType::get({1}, type, {}, kSharedMemorySpace); in allocateGlobalSharedMemory() 783 interleave(memrefType.getShape(), os, "x"); in allocateGlobalSharedMemory() 784 os << "x" << memrefType.getElementType(); in allocateGlobalSharedMemory() 793 /*type=*/memrefType, in allocateGlobalSharedMemory() 803 return builder.create<memref::GetGlobalOp>(loc, memrefType, symbolName); in allocateGlobalSharedMemory()
|
| /llvm-project-15.0.7/mlir/lib/Dialect/Utils/ |
| H A D | ReshapeOpsUtils.cpp | 269 if (auto memrefType = type.dyn_cast<MemRefType>()) in hasNonIdentityLayout() local 270 return !memrefType.getLayout().isIdentity(); in hasNonIdentityLayout()
|
| /llvm-project-15.0.7/mlir/lib/Dialect/Vector/Transforms/ |
| H A D | VectorTransferOpTransforms.cpp | 347 static int64_t getContiguousInnerDim(MemRefType memrefType, in getContiguousInnerDim() argument 349 auto shape = memrefType.getShape(); in getContiguousInnerDim() 353 if (succeeded(getStridesAndOffset(memrefType, strides, offset))) { in getContiguousInnerDim()
|
| /llvm-project-15.0.7/mlir/lib/Conversion/LLVMCommon/ |
| H A D | TypeConverter.cpp | 505 if (auto memrefType = operand.getType().dyn_cast<MemRefType>()) { in promoteOperands() local 517 if (auto memrefType = operand.getType().dyn_cast<MemRefType>()) { in promoteOperands() local 518 MemRefDescriptor::unpack(builder, loc, llvmOperand, memrefType, in promoteOperands()
|
| /llvm-project-15.0.7/mlir/lib/Dialect/SCF/Transforms/ |
| H A D | BufferizableOpInterfaceImpl.cpp | 31 static void ensureToMemrefOpIsValid(Value tensor, Type memrefType) { in ensureToMemrefOpIsValid() argument 34 assert((!rankedTensorType || (memrefType.cast<MemRefType>().getRank() == in ensureToMemrefOpIsValid() 190 BaseMemRefType memrefType = getMemRefTypeWithFullyDynamicLayout( in bufferize() local 194 thenYieldOp.getLoc(), memrefType, thenValue)); in bufferize() 197 elseYieldOp.getLoc(), memrefType, elseValue)); in bufferize()
|
| /llvm-project-15.0.7/mlir/include/mlir/Dialect/Affine/ |
| H A D | Utils.h | 248 MemRefType normalizeMemRefType(MemRefType memrefType, OpBuilder builder,
|
| /llvm-project-15.0.7/flang/lib/Optimizer/Builder/ |
| H A D | Character.cpp | 680 auto memrefType = memref.getType(); in getLength() local 681 auto charType = recoverCharacterType(memrefType); in getLength() 686 if (memrefType.isa<fir::BoxType>()) in getLength() 688 if (memrefType.isa<fir::BoxCharType>()) in getLength()
|
| /llvm-project-15.0.7/mlir/lib/Conversion/VectorToGPU/ |
| H A D | VectorToGPU.cpp | 94 auto memrefType = type.dyn_cast<MemRefType>(); in getMemrefConstantHorizontalStride() local 95 if (!memrefType) in getMemrefConstantHorizontalStride() 98 if (memrefType.getRank() < 2) in getMemrefConstantHorizontalStride() 102 if (failed(getStridesAndOffset(memrefType, strides, offset)) || in getMemrefConstantHorizontalStride()
|
| /llvm-project-15.0.7/mlir/lib/Dialect/GPU/IR/ |
| H A D | GPUDialect.cpp | 1379 auto memrefType = dimOp.getSource().getType().dyn_cast<MemRefType>(); in matchAndRewrite() local 1380 if (!memrefType || !memrefType.isDynamicDim(index.value())) in matchAndRewrite() 1388 memrefType.getDynamicDimIndex(index.value())); in matchAndRewrite()
|