Home
last modified time | relevance | path

Searched refs:padOp (Results 1 – 13 of 13) sorted by relevance

/llvm-project-15.0.7/mlir/lib/Dialect/Linalg/Transforms/
H A DFusePadOpWithLinalgProducer.cpp44 LogicalResult matchAndRewrite(tensor::PadOp padOp, in matchAndRewrite()
47 Value padValue = padOp.getConstantPaddingValue(); in matchAndRewrite()
49 return rewriter.notifyMatchFailure(padOp, "non constant padding"); in matchAndRewrite()
53 Value source = padOp.getSource(); in matchAndRewrite()
57 padOp, "expected source to be linalg.generic op"); in matchAndRewrite()
66 dyn_cast<ReifyRankedShapedTypeOpInterface>(padOp.getOperation()); in matchAndRewrite()
71 padOp, "failed to get shape of pad op result"); in matchAndRewrite()
74 Location loc = padOp.getLoc(); in matchAndRewrite()
77 RankedTensorType padResultType = padOp.getResultType(); in matchAndRewrite()
93 SmallVector<OpFoldResult> offsets = padOp.getMixedLowPad(); in matchAndRewrite()
[all …]
H A DTransforms.cpp426 if (!padOp || en.value() == 0) in returningMatchAndRewrite()
444 rewriter.replaceOp(padOp, *newResult); in returningMatchAndRewrite()
697 Location loc = padOp.getLoc(); in matchAndRewrite()
723 padOp, resultShapedType, padOp.getSource(), tmpTensor, transferMaps, in matchAndRewrite()
743 padOp.getLoc(), padOp.getResultType(), dynSizes); in createFillOrGenerateOp()
771 padOp.getLoc(), padOp.getSource(), dim); in matchAndRewrite()
774 padOp.getLoc(), srcSize, getIdxValue(padOp.getMixedLowPad()[dim])); in matchAndRewrite()
776 padOp.getLoc(), plusLow, getIdxValue(padOp.getMixedHighPad()[dim])); in matchAndRewrite()
799 padOp.getLoc(), padOp.getSource(), dim)); in matchAndRewrite()
808 padOp, padOp.getSource(), fill, padOp.getMixedLowPad(), srcSizes, in matchAndRewrite()
[all …]
H A DHoistPadding.cpp57 HoistingAnalysis(tensor::PadOp padOp, int numLoops);
112 for (OpOperand &use : padOp.getResult().getUses()) { in isOnlyUsedAsInputOfLinalgOp()
115 LLVM_DEBUG(DBGS() << "Found a use of " << *(padOp) in isOnlyUsedAsInputOfLinalgOp()
130 getAtMostNEnclosingLoops(tensor::PadOp padOp, int nLevels, in getAtMostNEnclosingLoops() argument
132 AsmState state(padOp->getParentOfType<func::FuncOp>()); in getAtMostNEnclosingLoops()
135 Operation *nextEnclosingOp = padOp->getParentOp(); in getAtMostNEnclosingLoops()
173 if (!isOnlyUsedAsInputOfLinalgOp(padOp)) in HoistingAnalysis()
214 Value paddingValue = padOp.getConstantPaddingValue(); in HoistingAnalysis()
230 backwardSlice.insert(padOp.getOperation()); in HoistingAnalysis()
235 if (failed(dropNonIndexDependencies(padOp, sliceOp))) in HoistingAnalysis()
[all …]
H A DVectorization.cpp692 auto sourceType = padOp.getSourceType(); in tryVectorizeCopy()
693 auto resultType = padOp.getResultType(); in tryVectorizeCopy()
698 auto padValue = padOp.getConstantPaddingValue(); in tryVectorizeCopy()
743 padOp.getLoc(), vecType, padOp.getSource(), readIndices, padValue, in tryVectorizeCopy()
755 ofrToIndexValues(rewriter, padOp.getLoc(), padOp.getMixedLowPad()); in tryVectorizeCopy()
769 LogicalResult matchAndRewrite(tensor::PadOp padOp, in matchAndRewrite()
811 if (!padOp.hasZeroLowPad()) in rewriteUser()
877 if (!padOp.hasZeroLowPad()) in rewriteUser()
1027 if (!padOp.hasZeroLowPad()) in rewriteUser()
1040 if (insertOp.getDest() == padOp.getResult()) in rewriteUser()
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/Tensor/Transforms/
H A DSplitPadding.cpp49 LogicalResult matchAndRewrite(tensor::PadOp padOp, in matchAndRewrite()
52 if (padOp->getParentOfType<scf::IfOp>()) in matchAndRewrite()
56 SmallVector<OpFoldResult> lowPads = padOp.getMixedLowPad(); in matchAndRewrite()
57 SmallVector<OpFoldResult> highPads = padOp.getMixedHighPad(); in matchAndRewrite()
62 Location loc = padOp.getLoc(); in matchAndRewrite()
77 auto thenBuilder = [&padOp](OpBuilder &builder, Location loc) { in matchAndRewrite()
78 builder.create<scf::YieldOp>(loc, padOp.getSource()); in matchAndRewrite()
80 auto elseBuilder = [&padOp](OpBuilder &builder, Location loc) { in matchAndRewrite()
81 Operation *newOp = builder.clone(*padOp); in matchAndRewrite()
84 rewriter.replaceOpWithNewOp<scf::IfOp>(padOp, padOp.getType(), ifCond, in matchAndRewrite()
/llvm-project-15.0.7/mlir/lib/Dialect/Tensor/IR/
H A DTensorTilingInterfaceImpl.cpp30 auto padOp = cast<PadOp>(op); in getDestinationOperands() local
33 op->getLoc(), mixedSizes, padOp.getResultType().getElementType()); in getDestinationOperands()
38 auto padOp = cast<PadOp>(op); in getLoopIteratorTypes() local
39 SmallVector<StringRef> iteratorTypes(padOp.getResultType().getRank(), in getLoopIteratorTypes()
76 Operation *tensor::bubbleUpPadSlice(OpBuilder &b, tensor::PadOp padOp, in bubbleUpPadSlice() argument
81 Value padValue = padOp.getConstantPaddingValue(); in bubbleUpPadSlice()
87 Location loc = padOp->getLoc(); in bubbleUpPadSlice()
134 int64_t rank = padOp.getSourceType().getRank(); in bubbleUpPadSlice()
224 RankedTensorType::get(shape, padOp.getResultType().getElementType()); in bubbleUpPadSlice()
249 loc, padOp.getSource(), newOffsets, newLengths, newStrides); in bubbleUpPadSlice()
[all …]
H A DTensorInferTypeOpInterfaceImpl.cpp172 auto padOp = cast<PadOp>(op); in reifyResultShapes() local
173 Location loc = padOp.getLoc(); in reifyResultShapes()
174 auto lowPad = padOp.getMixedLowPad(); in reifyResultShapes()
175 auto highPad = padOp.getMixedHighPad(); in reifyResultShapes()
177 for (auto dim : llvm::seq<int64_t>(0, padOp.getSourceType().getRank())) { in reifyResultShapes()
181 b.createOrFold<tensor::DimOp>(loc, padOp.getSource(), dim)); in reifyResultShapes()
H A DTensorOps.cpp2074 LogicalResult matchAndRewrite(PadOp padOp, in matchAndRewrite()
2087 int64_t rank = padOp.getSourceType().getRank(); in matchAndRewrite()
2089 return rewriter.notifyMatchFailure(padOp, in matchAndRewrite()
2096 padOp, "cannot fold non-unit stride ExtractSliceOps"); in matchAndRewrite()
2100 if (!padOp.hasZeroLowPad() || !outerPadOp.hasZeroLowPad()) { in matchAndRewrite()
2101 return rewriter.notifyMatchFailure(padOp, in matchAndRewrite()
2107 Value innerValue = padOp.getConstantPaddingValue(); in matchAndRewrite()
2118 llvm::SmallBitVector innerDims = padOp.getPaddedDims(); in matchAndRewrite()
2184 padOp.getLoc(), padOp.getResultType(), newSliceOp.getResult(), in matchAndRewrite()
2185 padOp.getMixedLowPad(), newHighPad, padOp.getNofold()); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/include/mlir/Dialect/Tensor/IR/
H A DTensorTilingInterfaceImpl.h42 Operation *bubbleUpPadSlice(OpBuilder &b, tensor::PadOp padOp,
/llvm-project-15.0.7/mlir/lib/Dialect/Linalg/IR/
H A DLinalgOps.cpp522 LogicalResult matchAndRewrite(tensor::PadOp padOp, in matchAndRewrite()
524 auto fillOp = padOp.getSource().getDefiningOp<linalg::FillOp>(); in matchAndRewrite()
530 Value padValue = padOp.getConstantPaddingValue(); in matchAndRewrite()
536 cast<ReifyRankedShapedTypeOpInterface>(padOp.getOperation()); in matchAndRewrite()
539 padOp, "failed to reify tensor.pad op result shape"); in matchAndRewrite()
541 auto oldResultType = padOp.getResultType(); in matchAndRewrite()
545 padOp.getLoc(), reifiedShape.front(), staticShape, in matchAndRewrite()
549 rewriter.replaceOpWithNewOp<tensor::CastOp>(padOp, oldResultType, in matchAndRewrite()
/llvm-project-15.0.7/mlir/lib/Conversion/TosaToLinalg/
H A DTosaToLinalg.cpp1837 LogicalResult matchAndRewrite(tosa::PadOp padOp, in matchAndRewrite() argument
1839 auto loc = padOp.getLoc(); in matchAndRewrite()
1840 auto input = padOp.getInput1(); in matchAndRewrite()
1841 auto padding = padOp.getPadding(); in matchAndRewrite()
1851 if (padOp.getPadConst()) { in matchAndRewrite()
1853 loc, padOp.getPadConst(), ValueRange({})); in matchAndRewrite()
1860 } else if (elementTy.isa<IntegerType>() && padOp.getQuantizationInfo()) { in matchAndRewrite()
1861 int64_t value = padOp.getQuantizationInfo()->getInputZp(); in matchAndRewrite()
1870 padOp, "tosa.pad was unable to determine the pad constant value."); in matchAndRewrite()
1901 padOp.getType(), input, padConstant, lowValues, highValues, in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/Linalg/Utils/
H A DUtils.cpp392 auto padOp = current ? current.getDefiningOp<tensor::PadOp>() : nullptr; in makeComposedPadHighOp() local
396 if (!padOp) in makeComposedPadHighOp()
404 if (llvm::any_of(padOp.getMixedLowPad(), [](OpFoldResult ofr) { in makeComposedPadHighOp()
411 auto padOpSliceOp = padOp.getSource().getDefiningOp<tensor::ExtractSliceOp>(); in makeComposedPadHighOp()
427 Value padOpPad = padOp.getConstantPaddingValue(); in makeComposedPadHighOp()
/llvm-project-15.0.7/mlir/include/mlir/Dialect/Linalg/Transforms/
H A DTransforms.h1190 LogicalResult matchAndRewrite(tensor::PadOp padOp,
1218 LogicalResult matchAndRewrite(tensor::PadOp padOp,
1223 Value createFillOrGenerateOp(PatternRewriter &rewriter, tensor::PadOp padOp,