Home
last modified time | relevance | path

Searched refs:ForOp (Results 1 – 25 of 59) sorted by relevance

123

/llvm-project-15.0.7/mlir/include/mlir/Dialect/SCF/Utils/
H A DUtils.h51 scf::ForOp replaceLoopWithNewYields(OpBuilder &builder, scf::ForOp loop,
69 SmallVector<scf::ForOp>
119 void coalesceLoops(MutableArrayRef<scf::ForOp> loops);
129 LogicalResult promoteIfSingleIteration(scf::ForOp forOp);
136 scf::ForOp forOp, uint64_t unrollFactor,
142 using Loops = SmallVector<scf::ForOp, 8>;
152 ArrayRef<scf::ForOp> targets);
158 Loops tile(ArrayRef<scf::ForOp> forOps, ArrayRef<Value> sizes,
159 scf::ForOp target);
172 void getPerfectlyNestedLoops(SmallVectorImpl<scf::ForOp> &nestedLoops,
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/SCF/Transforms/
H A DLoopSpecialization.cpp30 using scf::ForOp;
75 static void specializeForLoopForUnrolling(ForOp op) { in specializeForLoopForUnrolling()
111 static LogicalResult peelForLoop(RewriterBase &b, ForOp forOp, in peelForLoop()
138 partialIteration = cast<ForOp>(b.clone(*forOp.getOperation())); in peelForLoop()
152 ForOp partialIteration, in rewriteAffineOpAfterPeeling()
176 ForOp forOp, in peelAndCanonicalizeForLoop()
196 struct ForLoopPeelingPattern : public OpRewritePattern<ForOp> {
198 : OpRewritePattern<ForOp>(ctx), skipPartial(skipPartial) {} in ForLoopPeelingPattern()
200 LogicalResult matchAndRewrite(ForOp forOp, in matchAndRewrite()
209 while ((op = op->getParentOfType<scf::ForOp>())) { in matchAndRewrite()
[all …]
H A DStructuralTypeConversions.cpp19 class ConvertForOpTypes : public OpConversionPattern<ForOp> {
23 matchAndRewrite(ForOp op, OpAdaptor adaptor, in matchAndRewrite()
51 ForOp newOp = cast<ForOp>(rewriter.cloneWithoutRegions(*op.getOperation())); in matchAndRewrite()
183 target.addDynamicallyLegalOp<ForOp, IfOp>([&](Operation *op) { in populateSCFStructuralTypeConversionsAndLegality()
189 if (!isa<ForOp, IfOp, WhileOp>(op->getParentOp())) in populateSCFStructuralTypeConversionsAndLegality()
H A DLoopCanonicalization.cpp33 static bool isShapePreserving(ForOp forOp, int64_t arg) { in isShapePreserving()
50 .template Case<ForOp>([&](ForOp forOp) { in isShapePreserving()
92 auto forOp = dyn_cast<ForOp>(blockArg.getParentBlock()->getParentOp()); in matchAndRewrite()
134 auto forOp = dimOp.getSource().template getDefiningOp<scf::ForOp>(); in matchAndRewrite()
158 if (scf::ForOp forOp = scf::getForInductionVarOwner(iv)) { in matchAndRewrite()
H A DForToWhile.cpp23 using scf::ForOp;
28 struct ForLoopLoweringPattern : public OpRewritePattern<ForOp> {
29 using OpRewritePattern<ForOp>::OpRewritePattern;
31 LogicalResult matchAndRewrite(ForOp forOp, in matchAndRewrite()
H A DLoopPipelining.cpp37 ForOp forOp;
61 bool initializeLoopInfo(ForOp op, const PipeliningOption &options);
68 scf::ForOp createKernelLoop(
75 scf::ForOp newForOp,
85 ForOp op, const PipeliningOption &options) { in initializeLoopInfo()
200 scf::ForOp LoopPipelinerInternal::createKernelLoop( in createKernelLoop()
244 rewriter.create<scf::ForOp>(forOp.getLoc(), forOp.getLowerBound(), newUb, in createKernelLoop()
250 scf::ForOp newForOp, in createKernel()
442 FailureOr<ForOp> ForLoopPipeliningPattern::returningMatchAndRewrite( in returningMatchAndRewrite()
443 ForOp forOp, PatternRewriter &rewriter) const { in returningMatchAndRewrite()
[all …]
H A DTileUsingInterface.cpp98 static SmallVector<scf::ForOp>
107 SmallVector<scf::ForOp> loops; in generateTileLoopNest()
128 auto loop = builder.create<scf::ForOp>( in generateTileLoopNest()
313 SmallVector<scf::ForOp> newLoops = replaceLoopNestWithNewYields( in returningMatchAndRewrite()
348 auto loopOp = dyn_cast<scf::ForOp>(blockArg.getOwner()->getParentOp()); in getFusableProducer()
360 static void replaceIterArgs(scf::ForOp outerFor, scf::ForOp innerFor, in replaceIterArgs()
478 scf::ForOp outerMostTiledLoop = tileAndFuseResult.loops.front(); in returningMatchAndRewrite()
H A DBufferizableOpInterfaceImpl.cpp378 scf::ForOp> {
383 auto forOp = cast<scf::ForOp>(op); in bufferizesToMemoryRead()
395 auto forOp = cast<scf::ForOp>(op); in getAliasingOpResult()
403 auto forOp = cast<scf::ForOp>(op); in bufferRelation()
440 auto forOp = cast<scf::ForOp>(op); in resolveConflicts()
477 auto forOp = cast<scf::ForOp>(op); in getBufferType()
484 auto forOp = cast<scf::ForOp>(op); in bufferize()
499 auto newForOp = rewriter.create<scf::ForOp>( in bufferize()
537 auto forOp = cast<scf::ForOp>(op); in verifyAnalysis()
885 if (!isa<scf::ExecuteRegionOp, scf::IfOp, scf::ForOp, scf::WhileOp>( in bufferize()
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/SCF/Utils/
H A DUtils.cpp40 scf::ForOp
49 scf::ForOp newLoop = builder.create<scf::ForOp>( in replaceLoopWithNewYields()
600 static void normalizeLoop(scf::ForOp loop, scf::ForOp outer, scf::ForOp inner) { in normalizeLoop()
660 scf::ForOp second = loops[1]; in coalesceLoops()
756 static LogicalResult hoistOpsBetween(scf::ForOp outer, scf::ForOp inner) { in hoistOpsBetween()
773 if (isa<scf::ForOp>(op)) in hoistOpsBetween()
874 static scf::ForOp stripmineSink(scf::ForOp forOp, SizeType factor, in stripmineSink()
899 scf::ForOp target) { in tile()
900 SmallVector<scf::ForOp, 8> res; in tile()
911 SmallVector<scf::ForOp, 4> forOps; in tilePerfectlyNested()
[all …]
/llvm-project-15.0.7/mlir/include/mlir/Dialect/SCF/Transforms/
H A DPatterns.h34 class ForLoopPipeliningPattern : public OpRewritePattern<ForOp> {
38 : OpRewritePattern<ForOp>(context), options(options) {} in ForLoopPipeliningPattern()
39 LogicalResult matchAndRewrite(ForOp forOp, in matchAndRewrite()
44 FailureOr<ForOp> returningMatchAndRewrite(ForOp forOp,
H A DTransforms.h38 class ForOp; variable
88 LogicalResult peelAndCanonicalizeForLoop(RewriterBase &rewriter, ForOp forOp,
89 scf::ForOp &partialIteration);
128 scf::ForOp, std::vector<std::pair<Operation *, unsigned>> &)>;
H A DTileUsingInterface.h65 SmallVector<scf::ForOp> loops;
111 SmallVector<scf::ForOp> loops;
/llvm-project-15.0.7/mlir/lib/Dialect/Linalg/Transforms/
H A DHoistPadding.cpp66 scf::ForOp outermostEnclosingForOp;
77 SmallVector<scf::ForOp> packingLoops;
134 scf::ForOp outermostEnclosingForOp = nullptr; in getAtMostNEnclosingLoops()
177 SmallVector<scf::ForOp> reverseEnclosingLoops; in HoistingAnalysis()
243 for (scf::ForOp forOp : llvm::reverse(reverseEnclosingLoops)) in HoistingAnalysis()
306 if (auto forOp = dyn_cast<scf::ForOp>(op)) { in dropNonIndexDependencies()
373 static bool isDefinedOutsideOrConstant(scf::ForOp outer, Value v) { in isDefinedOutsideOrConstant()
382 scf::ForOp forOp) { in buildLoopIterationCount()
408 scf::ForOp outer = analysis.outermostEnclosingForOp; in hoistPaddingOnTensors()
459 auto forOp = dyn_cast<scf::ForOp>(op); in hoistPaddingOnTensors()
[all …]
H A DHoisting.cpp190 if (auto forUser = dyn_cast<scf::ForOp>(user)) { in tensorChunkAccessedByUnknownOp()
223 getLoopInvariantTransferWriteOpDefining(scf::ForOp forOp, in getLoopInvariantTransferWriteOpDefining()
263 scf::ForOp forOp = cast<scf::ForOp>(tensorBBArg.getOwner()->getParentOp()); in hoistReadWrite()
353 func.walk([&](scf::ForOp forOp) { in hoistRedundantVectorTransfersOnTensor()
395 scf::ForOp::getCanonicalizationPatterns(patterns, func->getContext()); in hoistRedundantVectorTransfersOnTensor()
416 auto loop = dyn_cast<scf::ForOp>(transferRead->getParentOp()); in hoistRedundantVectorTransfers()
/llvm-project-15.0.7/mlir/lib/Dialect/SCF/TransformOps/
H A DSCFTransformOps.cpp40 scf::ForOp loop; in apply()
43 loop = current->getParentOfType<scf::ForOp>(); in apply()
47 << scf::ForOp::getOperationName() in apply()
132 transform::LoopPeelOp::applyToOne(scf::ForOp target, in applyToOne()
135 scf::ForOp result; in applyToOne()
156 loopScheduling(scf::ForOp forOp, in loopScheduling()
189 transform::LoopPipelineOp::applyToOne(scf::ForOp target, in applyToOne()
194 [this](scf::ForOp forOp, in applyToOne()
202 FailureOr<scf::ForOp> patternResult = in applyToOne()
217 transform::LoopUnrollOp::applyToOne(scf::ForOp target, in applyToOne()
/llvm-project-15.0.7/mlir/test/lib/Dialect/SCF/
H A DTestLoopUnrolling.cpp27 if (isa<scf::ForOp>(currOp)) in getNestingDepth()
56 SmallVector<scf::ForOp, 4> loops; in runOnOperation()
57 getOperation()->walk([&](scf::ForOp forOp) { in runOnOperation()
H A DTestLoopParametricTiling.cpp43 getOperation()->walk([this](scf::ForOp op) { in runOnOperation()
45 if (op->getParentRegion()->getParentOfType<scf::ForOp>()) in runOnOperation()
H A DTestSCFUtils.cpp45 SmallVector<scf::ForOp, 4> toErase; in runOnOperation()
48 func.walk([&](scf::ForOp forOp) { in runOnOperation()
132 getSchedule(scf::ForOp forOp, in getSchedule()
/llvm-project-15.0.7/mlir/lib/Dialect/SCF/IR/
H A DSCF.cpp301 LogicalResult ForOp::verify() { in verify()
318 LogicalResult ForOp::verifyRegions() { in verifyRegions()
386 void ForOp::print(OpAsmPrinter &p) { in print()
466 return ForOp(); in getForInductionVarOwner()
529 SmallVector<scf::ForOp, 4> loops; in buildLoopNest()
536 auto loop = builder.create<scf::ForOp>( in buildLoopNest()
661 scf::ForOp newForOp = rewriter.create<scf::ForOp>( in matchAndRewrite()
724 LogicalResult matchAndRewrite(ForOp op, in matchAndRewrite()
789 ForOp forOp = cast<ForOp>(operand.getOwner()); in replaceTensorCastForOpIterArg()
804 scf::ForOp newForOp = rewriter.create<scf::ForOp>( in replaceTensorCastForOpIterArg()
[all …]
/llvm-project-15.0.7/mlir/test/lib/Dialect/Affine/
H A DTestLoopMapping.cpp53 getOperation()->walk([&processorIds, &numProcessors](scf::ForOp op) { in runOnOperation()
55 if (op->getParentRegion()->getParentOfType<scf::ForOp>()) in runOnOperation()
/llvm-project-15.0.7/mlir/test/python/dialects/
H A Dscf.py27 loop = scf.ForOp(lb, ub, step, [lb, lb])
46 loop = scf.ForOp(lb, ub, step, [lb])
68 loop = scf.ForOp(lb, ub, step, iter_args)
/llvm-project-15.0.7/mlir/lib/Conversion/SCFToControlFlow/
H A DSCFToControlFlow.cpp98 struct ForLowering : public OpRewritePattern<ForOp> {
99 using OpRewritePattern<ForOp>::OpRewritePattern;
101 LogicalResult matchAndRewrite(ForOp forOp,
290 LogicalResult ForLowering::matchAndRewrite(ForOp forOp, in matchAndRewrite()
466 ForOp forOp = rewriter.create<ForOp>(loc, lower, upper, step, iterArgs); in matchAndRewrite()
628 target.addIllegalOp<scf::ForOp, scf::IfOp, scf::ParallelOp, scf::WhileOp, in runOnOperation()
/llvm-project-15.0.7/mlir/include/mlir/Dialect/SCF/IR/
H A DSCF.h47 ForOp getForInductionVarOwner(Value val);
64 using LoopVector = std::vector<scf::ForOp>;
/llvm-project-15.0.7/mlir/lib/Conversion/VectorToGPU/
H A DVectorToGPU.cpp191 if (isa<scf::ForOp, scf::YieldOp>(op)) in supportsMMaMatrixType()
230 if (auto forOp = dyn_cast<scf::ForOp>(currentOp)) { in getSliceContract()
730 static scf::ForOp replaceForOpWithNewSignature(OpBuilder &b, scf::ForOp loop, in replaceForOpWithNewSignature()
737 scf::ForOp newLoop = in replaceForOpWithNewSignature()
738 b.create<scf::ForOp>(loop.getLoc(), loop.getLowerBound(), in replaceForOpWithNewSignature()
754 static void convertForOp(scf::ForOp op, in convertForOp()
767 scf::ForOp newForOp = replaceForOpWithNewSignature(b, op, newOperands); in convertForOp()
781 auto loop = cast<scf::ForOp>(op->getParentOp()); in convertYieldOp()
834 } else if (auto forOp = dyn_cast<scf::ForOp>(op)) { in convertVectorToMMAOps()
859 .Case([&](scf::ForOp forOp) { in convertVectorToNVVMCompatibleMMASync()
/llvm-project-15.0.7/mlir/include/mlir/Dialect/SCF/TransformOps/
H A DSCFTransformOps.td78 This operation ignores non-scf::ForOp ops and drops them in the return.
80 This operation always succeeds and returns the scf::ForOp with the
102 ::mlir::scf::ForOp target,
143 ::mlir::scf::ForOp target,
175 ::mlir::scf::ForOp target,

123