Home
last modified time | relevance | path

Searched refs:sliceOp (Results 1 – 24 of 24) sorted by relevance

/llvm-project-15.0.7/mlir/lib/Dialect/Linalg/Transforms/
H A DBubbleUpExtractSlice.cpp50 LogicalResult matchAndRewrite(tensor::ExtractSliceOp sliceOp, in matchAndRewrite()
52 Value source = sliceOp.getSource(); in matchAndRewrite()
55 return rewriter.notifyMatchFailure(sliceOp, in matchAndRewrite()
62 return rewriter.notifyMatchFailure(sliceOp, in matchAndRewrite()
67 return rewriter.notifyMatchFailure(sliceOp, in matchAndRewrite()
72 return rewriter.notifyMatchFailure(sliceOp, in matchAndRewrite()
76 if (!sliceOp.hasUnitStride()) in matchAndRewrite()
79 if (sliceOp.getType().getRank() != sliceOp.getSourceType().getRank()) { in matchAndRewrite()
101 auto sliceLoc = sliceOp.getLoc(); in matchAndRewrite()
103 rewriter, sliceLoc, sliceOp.getMixedOffsets()); in matchAndRewrite()
[all …]
H A DFusionOnTensors.cpp130 tensor::ExtractSliceOp sliceOp, in getTiledProducer() argument
137 b.setInsertionPointAfter(sliceOp); in getTiledProducer()
246 tensor::ExtractSliceOp sliceOp) { in hasOtherUses() argument
254 if (extractSliceOp != sliceOp) in hasOtherUses()
342 auto sliceOp = in fuseProducer() local
344 if (!sliceOp) in fuseProducer()
349 if (sliceOp->getBlock() != rootOp->getBlock() || in fuseProducer()
361 auto producerResult = sliceOp.getSource().dyn_cast<OpResult>(); in fuseProducer()
362 if (auto bbArg = sliceOp.getSource().dyn_cast<BlockArgument>()) { in fuseProducer()
365 if (!iterArg || hasOtherUses(bbArg, sliceOp)) in fuseProducer()
[all …]
H A DHoisting.cpp116 tensor::ExtractSliceOp sliceOp; in findMatchingTransferRead() local
119 sliceOp = dyn_cast<tensor::ExtractSliceOp>(user); in findMatchingTransferRead()
120 if (!sliceOp || sliceOp.getResult().getType() != in findMatchingTransferRead()
125 << *sliceOp << " vs " << *write.insertSliceOp << "\n"); in findMatchingTransferRead()
126 if (!sameOffsetsSizesAndStrides(sliceOp, write.insertSliceOp)) in findMatchingTransferRead()
136 for (Operation *u : sliceOp->getUsers()) { in findMatchingTransferRead()
155 return HoistableRead{read, sliceOp}; in findMatchingTransferRead()
431 for (auto *sliceOp : llvm::reverse(forwardSlice)) { in hoistRedundantVectorTransfers() local
432 auto candidateWrite = dyn_cast<vector::TransferWriteOp>(sliceOp); in hoistRedundantVectorTransfers()
H A DHoistPadding.cpp103 tensor::ExtractSliceOp sliceOp);
201 auto sliceOp = padOp.getSource().getDefiningOp<tensor::ExtractSliceOp>(); in HoistingAnalysis() local
202 if (!sliceOp) { in HoistingAnalysis()
206 if (!outermostEnclosingForOp.isDefinedOutsideOfLoop(sliceOp.getSource())) { in HoistingAnalysis()
235 if (failed(dropNonIndexDependencies(padOp, sliceOp))) in HoistingAnalysis()
257 tensor::ExtractSliceOp sliceOp) { in dropNonIndexDependencies() argument
300 if (op == padOp || op == sliceOp) { in dropNonIndexDependencies()
455 if (auto sliceOp = dyn_cast<tensor::ExtractSliceOp>(op)) in hoistPaddingOnTensors() local
456 if (bvm.lookupOrDefault(sliceOp.getSource()) == packedTensor) in hoistPaddingOnTensors()
H A DDropUnitDims.cpp464 LogicalResult matchAndRewrite(tensor::ExtractSliceOp sliceOp, in matchAndRewrite()
466 RankedTensorType resultType = sliceOp.getType(); in matchAndRewrite()
467 SmallVector<OpFoldResult> offsets = sliceOp.getMixedOffsets(); in matchAndRewrite()
468 SmallVector<OpFoldResult> sizes = sliceOp.getMixedSizes(); in matchAndRewrite()
469 SmallVector<OpFoldResult> strides = sliceOp.getMixedStrides(); in matchAndRewrite()
476 reassociation->size(), sliceOp.getSourceType(), offsets, sizes, in matchAndRewrite()
480 Location loc = sliceOp.getLoc(); in matchAndRewrite()
482 loc, rankReducedType, sliceOp.getSource(), offsets, sizes, strides); in matchAndRewrite()
484 sliceOp, resultType, newSlice, *reassociation); in matchAndRewrite()
H A DTilingInterfaceImpl.cpp128 auto sliceOp = sliceOpResult.getDefiningOp<tensor::ExtractSliceOp>(); in getResultTilePosition() local
129 if (!sliceOp) in getResultTilePosition()
131 resultOffsets = sliceOp.getMixedOffsets(); in getResultTilePosition()
132 resultSizes = sliceOp.getMixedSizes(); in getResultTilePosition()
H A DTiling.cpp374 tensor::ExtractSliceOp sliceOp, Value source, in insertSliceIntoTensor() argument
377 loc, sliceOp.getSource().getType(), source, dest, sliceOp.getOffsets(), in insertSliceIntoTensor()
378 sliceOp.getSizes(), sliceOp.getStrides(), sliceOp.getStaticOffsets(), in insertSliceIntoTensor()
379 sliceOp.getStaticSizes(), sliceOp.getStaticStrides()); in insertSliceIntoTensor()
595 auto sliceOp = tiledOutput.getDefiningOp<tensor::ExtractSliceOp>(); in tilePadOp() local
596 assert(sliceOp && "expected ExtractSliceOp"); in tilePadOp()
601 insertSliceIntoTensor(rewriter, loc, sliceOp, sliceOp, iterArgs[0]); in tilePadOp()
H A DFusion.cpp185 if (auto sliceOp = dyn_cast<tensor::ExtractSliceOp>(shapeProducingOp)) in getRangeFromOperandShape() local
186 return sliceOp.getOrCreateRanges(b, loc)[dim]; in getRangeFromOperandShape()
389 if (auto sliceOp = tensor.getDefiningOp<tensor::ExtractSliceOp>()) { in getProducerOfTensor() local
390 tensor = sliceOp.getSource(); in getProducerOfTensor()
429 auto sliceOp = inputTensor.getDefiningOp<tensor::ExtractSliceOp>(); in fuseProducerOfTensor() local
430 if (!sliceOp) { in fuseProducerOfTensor()
H A DTransforms.cpp208 auto sliceOp = currOpOperand->get().getDefiningOp<tensor::ExtractSliceOp>(); in padOperandToSmallestStaticBoundingBox() local
209 if (!sliceOp) in padOperandToSmallestStaticBoundingBox()
213 llvm::SmallBitVector droppedDims = sliceOp.getDroppedDims(); in padOperandToSmallestStaticBoundingBox()
214 OffsetSizeAndStrideOpInterface shapedOp = sliceOp; in padOperandToSmallestStaticBoundingBox()
815 tensor::ExtractSliceOp sliceOp, PatternRewriter &rewriter) const { in matchAndRewrite() argument
816 if (!sliceOp.hasUnitStride()) in matchAndRewrite()
819 auto padOp = sliceOp.getSource().getDefiningOp<tensor::PadOp>(); in matchAndRewrite()
825 if (Optional<bool> control = controlFn(sliceOp)) in matchAndRewrite()
832 tensor::bubbleUpPadSlice(rewriter, padOp, sliceOp.getMixedOffsets(), in matchAndRewrite()
833 sliceOp.getMixedSizes(), zeroSliceGuard); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Conversion/TosaToTensor/
H A DTosaToTensor.cpp29 LogicalResult matchAndRewrite(tosa::SliceOp sliceOp, in matchAndRewrite() argument
31 Location loc = sliceOp.getLoc(); in matchAndRewrite()
32 Value input = sliceOp.getInput(); in matchAndRewrite()
34 auto starts = sliceOp.getStart(); in matchAndRewrite()
35 auto sizes = sliceOp.getSize(); in matchAndRewrite()
36 strides.resize(sliceOp.getType().template cast<ShapedType>().getRank(), 1); in matchAndRewrite()
53 sliceOp.getLoc(), sliceOp.getType(), input, ValueRange({}), dynSizes, in matchAndRewrite()
56 rewriter.replaceOp(sliceOp, newSliceOp.getResult()); in matchAndRewrite()
/llvm-project-15.0.7/flang/lib/Optimizer/CodeGen/
H A DPreCGRewrite.cpp126 if (auto sliceOp = in rewriteDynamicShape() local
128 sliceOpers.assign(sliceOp.getTriples().begin(), in rewriteDynamicShape()
129 sliceOp.getTriples().end()); in rewriteDynamicShape()
131 sliceOp.getFields().end()); in rewriteDynamicShape()
132 substrOpers.assign(sliceOp.getSubstr().begin(), in rewriteDynamicShape()
133 sliceOp.getSubstr().end()); in rewriteDynamicShape()
182 if (auto sliceOp = in matchAndRewrite() local
185 sliceOp.getTriples().end()); in matchAndRewrite()
189 sliceOp.getSubstr().end()); in matchAndRewrite()
240 if (auto sliceOp = in matchAndRewrite() local
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/Tensor/Transforms/
H A DSwapExtractSliceWithProducer.cpp24 OpBuilder &builder, tensor::ExtractSliceOp sliceOp, OpResult producer) { in replaceExtractSliceWithTiledProducer() argument
30 if (llvm::any_of(sliceOp.getMixedStrides(), [](OpFoldResult ofr) { in replaceExtractSliceWithTiledProducer()
37 producerOp.getDestinationOperands(builder), sliceOp.getMixedOffsets(), in replaceExtractSliceWithTiledProducer()
38 sliceOp.getMixedSizes(), true); in replaceExtractSliceWithTiledProducer()
/llvm-project-15.0.7/mlir/lib/Dialect/Linalg/Utils/
H A DUtils.cpp379 auto sliceOp = source.getDefiningOp<tensor::ExtractSliceOp>(); in makeComposedPadHighOp() local
380 if (!sliceOp) in makeComposedPadHighOp()
384 Value current = sliceOp.getSource(); in makeComposedPadHighOp()
400 if (sliceOp.getSource().getType() != type) in makeComposedPadHighOp()
433 return sliceOp.getSource(); in makeComposedPadHighOp()
901 auto *sliceOp = TypeSwitch<ShapedType, Operation *>(shapedType) in makeTiledShape() local
913 return sliceOp->getResult(0); in makeTiledShape()
983 loc, sliceOp.getSource().getType(), results[resultIdx], in insertSlicesBack()
984 sliceOp.getSource(), sliceOp.getOffsets(), sliceOp.getSizes(), in insertSlicesBack()
985 sliceOp.getStrides(), sliceOp.getStaticOffsets(), in insertSlicesBack()
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/Tensor/IR/
H A DTensorOps.cpp366 if (sliceOp.getType().getRank() == sliceOp.getSourceType().getRank() && in fold()
367 sliceOp.isDynamicSize(unsignedIndex)) { in fold()
368 return {sliceOp.getDynamicSize(unsignedIndex)}; in fold()
1192 LogicalResult matchAndRewrite(ExtractSliceOp sliceOp, in matchAndRewrite() argument
1210 sliceOp.getType().getRank(), sliceOp.getSourceType(), in matchAndRewrite()
1211 sliceOp.getMixedOffsets(), sliceOp.getMixedSizes(), in matchAndRewrite()
1212 sliceOp.getMixedStrides()); in matchAndRewrite()
1214 sliceOp.getLoc(), resultType, castOp.getSource(), sliceOp.getOffsets(), in matchAndRewrite()
1215 sliceOp.getSizes(), sliceOp.getStrides(), sliceOp.getStaticOffsets(), in matchAndRewrite()
1216 sliceOp.getStaticSizes(), sliceOp.getStaticStrides()); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/include/mlir/Dialect/Tensor/Transforms/
H A DTransforms.h30 OpBuilder &builder, tensor::ExtractSliceOp sliceOp, OpResult producerOp);
/llvm-project-15.0.7/mlir/lib/Dialect/Linalg/TransformOps/
H A DLinalgTransformOps.cpp233 auto sliceOp = dyn_cast<tensor::ExtractSliceOp>(user); in tileAndFuse() local
234 if (!sliceOp) in tileAndFuse()
236 if (!containingOp->isProperAncestor(sliceOp)) in tileAndFuse()
238 sliceOps.push_back(sliceOp); in tileAndFuse()
250 for (tensor::ExtractSliceOp sliceOp : sliceOps) { in tileAndFuse() local
252 rewriter.setInsertionPoint(sliceOp); in tileAndFuse()
257 sliceOp.getMixedOffsets(), sliceOp.getMixedSizes(), true); in tileAndFuse()
/llvm-project-15.0.7/mlir/lib/Dialect/Affine/Transforms/
H A DPipelineDataTransfer.cpp326 for (auto sliceOp : sliceOps) { in runOnAffineForOp() local
327 instShiftMap[sliceOp.getOperation()] = 0; in runOnAffineForOp()
/llvm-project-15.0.7/flang/lib/Optimizer/Transforms/
H A DArrayValueCopy.cpp453 auto sliceOp = mlir::dyn_cast_or_null<SliceOp>(val.getDefiningOp()); in mutuallyExclusiveSliceRange() local
454 if (!sliceOp) in mutuallyExclusiveSliceRange()
456 return sliceOp; in mutuallyExclusiveSliceRange()
807 if (auto sliceOp = in getAdjustedExtents() local
809 auto triples = sliceOp.getTriples(); in getAdjustedExtents()
944 mlir::Value sliceOp, ArrayLoadOp arrLoad) { in genArrayCopy() argument
968 CopyIn && copyUsingSlice ? sliceOp : mlir::Value{}, in genArrayCopy()
973 !CopyIn && copyUsingSlice ? sliceOp : mlir::Value{}, in genArrayCopy()
/llvm-project-15.0.7/mlir/lib/Dialect/SCF/Transforms/
H A DTileUsingInterface.cpp407 if (auto sliceOp = operand.getDefiningOp<tensor::ExtractSliceOp>()) in returningMatchAndRewrite() local
408 candidates.push_back(sliceOp); in returningMatchAndRewrite()
/llvm-project-15.0.7/mlir/lib/Dialect/Linalg/IR/
H A DLinalgOps.cpp1307 LogicalResult matchAndRewrite(tensor::ExtractSliceOp sliceOp, in matchAndRewrite()
1309 if (!sliceOp.getSource().getDefiningOp<linalg::InitTensorOp>()) in matchAndRewrite()
1314 sliceOp, sliceOp.getSizes(), in matchAndRewrite()
1315 sliceOp.getResult().getType().cast<RankedTensorType>().getShape(), in matchAndRewrite()
1316 sliceOp.getSourceType().getElementType()); in matchAndRewrite()
/llvm-project-15.0.7/flang/lib/Optimizer/Dialect/
H A DFIROps.cpp391 if (auto sliceOp = getSlice()) { in verify() local
392 if (auto sl = mlir::dyn_cast_or_null<fir::SliceOp>(sliceOp.getDefiningOp())) in verify()
395 if (auto sliceTy = sliceOp.getType().dyn_cast<fir::SliceType>()) in verify()
458 if (auto sliceOp = getSlice()) { in verify() local
462 if (auto sliceTy = sliceOp.getType().dyn_cast<fir::SliceType>()) in verify()
481 if (auto sliceOp = in verify() local
483 if (!sliceOp.getSubstr().empty()) in verify()
486 if (!sliceOp.getFields().empty()) { in verify()
492 fir::applyPathToType(seqTy.getEleTy(), sliceOp.getFields()); in verify()
2242 if (auto sliceOp = sliceVal.getDefiningOp()) { in verify() local
[all …]
/llvm-project-15.0.7/mlir/include/mlir/Dialect/Linalg/Utils/
H A DUtils.h432 bool hasOtherUses(BlockArgument bbArg, tensor::ExtractSliceOp sliceOp);
/llvm-project-15.0.7/flang/lib/Optimizer/Builder/
H A DFIRBuilder.cpp967 auto sliceOp = mlir::dyn_cast_or_null<fir::SliceOp>(slice.getDefiningOp()); in arraySectionElementToExtendedValue() local
968 assert(sliceOp && "slice must be a sliceOp"); in arraySectionElementToExtendedValue()
969 if (sliceOp.getFields().empty()) in arraySectionElementToExtendedValue()
/llvm-project-15.0.7/mlir/include/mlir/Dialect/Linalg/Transforms/
H A DTransforms.h1332 LogicalResult matchAndRewrite(tensor::ExtractSliceOp sliceOp,