Home
last modified time | relevance | path

Searched refs:AffineForOp (Results 1 – 25 of 52) sorted by relevance

123

/llvm-project-15.0.7/mlir/include/mlir/Dialect/Affine/
H A DLoopUtils.h23 class AffineForOp; variable
42 LogicalResult loopUnrollFull(AffineForOp forOp);
49 AffineForOp forOp, uint64_t unrollFactor,
65 AffineForOp root);
71 LogicalResult loopUnrollJamByFactor(AffineForOp forOp,
104 tilePerfectlyNested(MutableArrayRef<AffineForOp> input,
117 void interchangeLoops(AffineForOp forOpA, AffineForOp forOpB);
139 AffineForOp sinkSequentialLoops(AffineForOp forOp);
146 SmallVector<SmallVector<AffineForOp, 8>, 8> tile(ArrayRef<AffineForOp> forOps,
154 SmallVector<AffineForOp, 8> tile(ArrayRef<AffineForOp> forOps,
[all …]
H A DLoopFusionUtils.h24 class AffineForOp; variable
113 canFuseLoops(AffineForOp srcForOp, AffineForOp dstForOp, unsigned dstLoopDepth,
121 void fuseLoops(AffineForOp srcForOp, AffineForOp dstForOp,
130 DenseMap<Operation *, SmallVector<AffineForOp, 2>> loopMap;
141 bool getLoopNestStats(AffineForOp forOp, LoopNestStats *stats);
148 int64_t getComputeCost(AffineForOp forOp, LoopNestStats &stats);
157 bool getFusionComputeCost(AffineForOp srcForOp, LoopNestStats &srcStats,
158 AffineForOp dstForOp, LoopNestStats &dstStats,
H A DUtils.h20 class AffineForOp; variable
46 affineParallelize(AffineForOp forOp,
154 vectorizeAffineLoopNest(std::vector<SmallVector<AffineForOp, 2>> &loops,
169 LogicalResult normalizeAffineFor(AffineForOp op);
/llvm-project-15.0.7/mlir/lib/Dialect/Affine/Transforms/
H A DLoopUnroll.cpp40 const std::function<unsigned(AffineForOp)> getUnrollFactor;
60 LogicalResult runOnAffineForOp(AffineForOp forOp);
65 static bool isInnermostAffineForOp(AffineForOp op) { in isInnermostAffineForOp()
67 ->walk([&](AffineForOp nestedForOp) { in isInnermostAffineForOp()
75 SmallVectorImpl<AffineForOp> &loops) { in gatherInnermostLoops()
76 f.walk([&](AffineForOp forOp) { in gatherInnermostLoops()
89 SmallVector<AffineForOp, 4> loops; in runOnOperation()
94 getOperation().walk([&](AffineForOp forOp) { in runOnOperation()
105 SmallVector<AffineForOp, 4> loops; in runOnOperation()
122 LogicalResult LoopUnroll::runOnAffineForOp(AffineForOp forOp) { in runOnAffineForOp()
[all …]
H A DSuperVectorize.cpp891 static void eraseLoopNest(AffineForOp forOp) { in eraseLoopNest()
923 auto loop = cast<AffineForOp>(forOp); in isVectorizableLoopPtrFactory()
964 auto vecForOp = cast<AffineForOp>(parentOp); in vectorizeConstant()
1483 if (auto forOp = dyn_cast<AffineForOp>(op)) in vectorizeOneOperation()
1533 AffineForOp rootLoop = loops[0][0]; in vectorizeLoopNest()
1617 SmallVector<AffineForOp, 8> bucketRoots; in computeIntersectionBuckets()
1620 AffineForOp matchRoot = cast<AffineForOp>(match.getMatchedOperation()); in computeIntersectionBuckets()
1623 AffineForOp bucketRoot = bucketRoots[i]; in computeIntersectionBuckets()
1752 f.walk([&parallelLoops](AffineForOp loop) { in runOnOperation()
1782 for (AffineForOp loop : loops[i]) { in verifyLoopNesting()
[all …]
H A DLoopTiling.cpp42 void getTileSizes(ArrayRef<AffineForOp> band,
66 static void adjustToDivisorsOfTripCounts(ArrayRef<AffineForOp> band, in adjustToDivisorsOfTripCounts()
90 void LoopTiling::getTileSizes(ArrayRef<AffineForOp> band, in getTileSizes()
110 AffineForOp rootForOp = band[0]; in getTileSizes()
165 std::vector<SmallVector<AffineForOp, 6>> bands; in runOnOperation()
180 SmallVector<AffineForOp, 6> tiledNest; in runOnOperation()
191 MutableArrayRef<AffineForOp>(tiledNest).drop_front(band.size()); in runOnOperation()
H A DAffineDataCopyGeneration.cpp126 return isa<AffineLoadOp, AffineStoreOp, AffineForOp>(op) && in runOnBlock()
133 AffineForOp forOp; in runOnBlock()
135 if ((forOp = dyn_cast<AffineForOp>(&*it)) && copyNests.count(forOp) == 0) { in runOnBlock()
141 auto exceedsCapacity = [&](AffineForOp forOp) { in runOnBlock()
177 return isa<AffineLoadOp, AffineStoreOp, AffineForOp>(op) && in runOnBlock()
223 if (auto forOp = dyn_cast<AffineForOp>(op)) in runOnOperation()
H A DAffineParallelize.cpp40 ParallelizationCandidate(AffineForOp l, SmallVector<LoopReduction> &&r) in ParallelizationCandidate()
44 AffineForOp loop;
56 f.walk<WalkOrder::PreOrder>([&](AffineForOp loop) { in runOnOperation()
64 AffineForOp loop = candidate.loop; in runOnOperation()
H A DAffineLoopInvariantCodeMotion.cpp49 void runOnAffineForOp(AffineForOp forOp);
78 } else if (auto forOp = dyn_cast<AffineForOp>(op)) { in isOpLoopInvariant()
106 SmallVector<AffineForOp, 8> userIVs; in isOpLoopInvariant()
197 void LoopInvariantCodeMotion::runOnAffineForOp(AffineForOp forOp) { in runOnAffineForOp()
235 getOperation().walk([&](AffineForOp op) { in runOnOperation()
H A DLoopFusion.cpp79 SmallVector<AffineForOp, 4> forOps;
86 if (isa<AffineForOp>(op)) in collect()
216 Node *getForOpNode(AffineForOp forOp) { in getForOpNode()
677 if (!isa<AffineForOp>(srcNode->op)) in getProducerCandidates()
829 SmallVector<AffineForOp, 4> loops; in init()
865 assert(isa<AffineForOp>(node->op)); in sinkSequentialLoops()
866 AffineForOp newRootForOp = sinkSequentialLoops(cast<AffineForOp>(node->op)); in sinkSequentialLoops()
1034 if (isa<AffineForOp>(op)) in hasNonAffineUsersOnThePath()
1106 SmallVector<AffineForOp, 4> srcLoopIVs; in isFusionProfitable()
1432 if (!isa<AffineForOp>(dstNode->op)) in fuseProducerConsumerNodes()
[all …]
/llvm-project-15.0.7/mlir/include/mlir/Dialect/Affine/Analysis/
H A DLoopAnalysis.h23 class AffineForOp; variable
37 void getTripCountMapAndOperands(AffineForOp forOp, AffineMap *map,
43 Optional<uint64_t> getConstantTripCount(AffineForOp forOp);
48 uint64_t getLargestDivisorOfTripCount(AffineForOp forOp);
62 using VectorizableLoopFun = std::function<bool(AffineForOp)>;
68 bool isVectorizableLoopBody(AffineForOp loop,
76 bool isVectorizableLoopBody(AffineForOp loop, int *memRefDim,
84 bool isOpwiseShiftValid(AffineForOp forOp, ArrayRef<uint64_t> shifts);
H A DUtils.h29 class AffineForOp; variable
39 void getLoopIVs(Operation &op, SmallVectorImpl<AffineForOp> *loops);
52 bool isLoopParallelAndContainsReduction(AffineForOp forOp);
56 void getSequentialLoops(AffineForOp forOp,
228 AffineForOp insertBackwardComputationSlice(Operation *srcOpInst,
369 Optional<int64_t> getMemoryFootprintBytes(AffineForOp forOp,
381 SmallVectorImpl<AffineForOp> *surroundingLoops = nullptr);
H A DAffineAnalysis.h26 class AffineForOp; variable
46 AffineForOp forOp, SmallVectorImpl<LoopReduction> &supportedReductions);
52 AffineForOp forOp,
60 bool isLoopMemoryParallel(AffineForOp forOp);
184 AffineForOp forOp, unsigned maxLoopDepth,
/llvm-project-15.0.7/mlir/lib/Dialect/Affine/Utils/
H A DLoopUtils.cpp304 AffineForOp res; in affineForOpBodySkew()
493 static void moveLoopBodyImpl(AffineForOp src, AffineForOp dest, in moveLoopBodyImpl()
502 void moveLoopBody(AffineForOp src, AffineForOp dest) { in moveLoopBody()
521 AffineForOp pointLoop = b.create<AffineForOp>(loc, 0, 0); in constructTiledLoopNest()
535 AffineForOp tileSpaceLoop = b.create<AffineForOp>(loc, 0, 0); in constructTiledLoopNest()
966 for (AffineForOp forOp : f.getOps<AffineForOp>()) { in getTileableBands()
1394 void mlir::interchangeLoops(AffineForOp forOpA, AffineForOp forOpB) { in interchangeLoops()
1557 AffineForOp mlir::sinkSequentialLoops(AffineForOp forOp) { in sinkSequentialLoops()
1680 static AffineForOp stripmineSink(AffineForOp forOp, SizeType factor, in stripmineSink()
1704 SmallVector<AffineForOp, 8> mlir::tile(ArrayRef<AffineForOp> forOps, in tile()
[all …]
H A DLoopFusionUtils.cpp118 SmallVector<AffineForOp, 4> loops; in getLastDependentOpInRange()
179 gatherLoadsAndStores(AffineForOp forOp, in gatherLoadsAndStores()
260 FusionResult mlir::canFuseLoops(AffineForOp srcForOp, AffineForOp dstForOp, in canFuseLoops()
377 if (!isa<AffineForOp>(parentOp)) in promoteSingleIterReductionLoop()
382 AffineForOp parentForOp = forOp->getParentOfType<AffineForOp>(); in promoteSingleIterReductionLoop()
432 void mlir::fuseLoops(AffineForOp srcForOp, AffineForOp dstForOp, in fuseLoops()
441 SmallVector<AffineForOp, 4> sliceLoops; in fuseLoops()
466 for (AffineForOp forOp : sliceLoops) { in fuseLoops()
486 if (!isa<AffineForOp>(parentForOp)) { in getLoopNestStats()
498 if (!isa<AffineForOp, AffineIfOp>(op)) in getLoopNestStats()
[all …]
/llvm-project-15.0.7/mlir/test/lib/Dialect/Affine/
H A DTestAffineLoopParametricTiling.cpp40 static void checkIfTilingParametersExist(ArrayRef<AffineForOp> band) { in checkIfTilingParametersExist()
42 AffineForOp topLoop = band[0]; in checkIfTilingParametersExist()
52 static void getTilingParameters(ArrayRef<AffineForOp> band, in getTilingParameters()
54 AffineForOp topLoop = band[0]; in getTilingParameters()
70 std::vector<SmallVector<AffineForOp, 6>> bands; in runOnOperation()
74 for (MutableArrayRef<AffineForOp> band : bands) { in runOnOperation()
77 SmallVector<AffineForOp, 6> tiledNest; in runOnOperation()
H A DTestLoopFusion.cpp60 static bool testDependenceCheck(AffineForOp srcForOp, AffineForOp dstForOp, in testDependenceCheck()
113 static bool testSliceComputation(AffineForOp forOpA, AffineForOp forOpB, in testSliceComputation()
135 static bool testLoopFusionTransformation(AffineForOp forOpA, AffineForOp forOpB, in testLoopFusionTransformation()
154 using LoopFunc = function_ref<bool(AffineForOp, AffineForOp, unsigned, unsigned,
160 static bool iterateLoops(ArrayRef<SmallVector<AffineForOp, 2>> depthToLoops, in iterateLoops() argument
181 std::vector<SmallVector<AffineForOp, 2>> depthToLoops; in runOnOperation()
H A DTestLoopPermutation.cpp52 SmallVector<AffineForOp, 2> forOps; in runOnOperation()
53 getOperation()->walk([&](AffineForOp forOp) { forOps.push_back(forOp); }); in runOnOperation()
56 SmallVector<AffineForOp, 6> nest; in runOnOperation()
/llvm-project-15.0.7/mlir/lib/Conversion/SCFToGPU/
H A DSCFToGPU.cpp84 static Value getOrCreateStep(AffineForOp forOp, OpBuilder &builder) { in getOrCreateStep()
91 static Value getOrEmitLowerBound(AffineForOp forOp, OpBuilder &builder) { in getOrEmitLowerBound()
107 static LogicalResult checkAffineLoopNestMappableImpl(AffineForOp forOp, in checkAffineLoopNestMappableImpl()
127 if (!(forOp = dyn_cast<AffineForOp>(nested))) in checkAffineLoopNestMappableImpl()
133 static LogicalResult checkAffineLoopNestMappable(AffineForOp forOp, in checkAffineLoopNestMappable()
154 Optional<AffineForOp> collectBounds(AffineForOp forOp, unsigned numLoops);
156 void createLaunch(AffineForOp rootForOp, AffineForOp innermostForOp,
182 Optional<AffineForOp>
189 AffineForOp currentLoop = forOp; in collectBounds()
209 currentLoop = cast<AffineForOp>(&currentLoop.getBody()->front()); in collectBounds()
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/Affine/Analysis/
H A DLoopAnalysis.cpp36 AffineForOp forOp, AffineMap *tripCountMap, in getTripCountMapAndOperands()
83 Optional<uint64_t> mlir::getConstantTripCount(AffineForOp forOp) { in getConstantTripCount()
109 uint64_t mlir::getLargestDivisorOfTripCount(AffineForOp forOp) { in getLargestDivisorOfTripCount()
263 using VectorizableOpFun = std::function<bool(AffineForOp, Operation &)>;
266 isVectorizableLoopBodyWithOpCond(AffineForOp loop, in isVectorizableLoopBodyWithOpCond()
281 return op.getNumRegions() != 0 && !isa<AffineIfOp, AffineForOp>(op); in isVectorizableLoopBodyWithOpCond()
316 bool mlir::isVectorizableLoopBody(AffineForOp loop, int *memRefDim, in isVectorizableLoopBody()
319 VectorizableOpFun fun([memRefDim](AffineForOp loop, Operation &op) { in isVectorizableLoopBody()
339 bool mlir::isVectorizableLoopBody(AffineForOp loop, in isVectorizableLoopBody()
349 bool mlir::isOpwiseShiftValid(AffineForOp forOp, ArrayRef<uint64_t> shifts) { in isOpwiseShiftValid()
H A DUtils.cpp37 AffineForOp currAffineForOp; in getLoopIVs()
41 if (AffineForOp currAffineForOp = dyn_cast<AffineForOp>(currOp)) in getLoopIVs()
59 if (isa<AffineIfOp, AffineForOp>(currOp)) in getEnclosingAffineForAndIfOps()
179 AffineForOp dstLoop = in isSliceMaximalFastCheck()
464 SmallVector<AffineForOp, 4> ivs; in compute()
565 AffineForOp iv; in compute()
1050 SmallVector<AffineForOp, 4> srcLoopIVs; in getComputationSliceState()
1055 SmallVector<AffineForOp, 4> dstLoopIVs; in getComputationSliceState()
1159 AffineForOp
1174 return AffineForOp(); in insertBackwardComputationSlice()
[all …]
H A DAffineAnalysis.cpp40 static Value getSupportedReduction(AffineForOp forOp, unsigned pos, in getSupportedReduction()
96 bool mlir::isLoopParallel(AffineForOp forOp, in isLoopParallel()
134 bool mlir::isLoopMemoryParallel(AffineForOp forOp) { in isLoopMemoryParallel()
151 } else if (!isa<AffineForOp, AffineYieldOp, AffineIfOp>(op) && in isLoopMemoryParallel()
243 SmallVector<AffineForOp, 8> forOps; in getIndexSet()
246 assert((isa<AffineForOp, AffineIfOp>(op)) && in getIndexSet()
248 if (AffineForOp forOp = dyn_cast<AffineForOp>(op)) in getIndexSet()
256 if (AffineForOp forOp = dyn_cast<AffineForOp>(op)) { in getIndexSet()
331 AffineForOp forOp = getForInductionVarOwner(commonForIV); in getCommonBlock()
411 SmallVector<AffineForOp, 4> commonLoops; in computeDirectionVector()
[all …]
/llvm-project-15.0.7/mlir/include/mlir/Dialect/Affine/IR/
H A DAffineOps.h440 AffineForOp getForInductionVarOwner(Value val);
444 void extractForInductionVars(ArrayRef<AffineForOp> forInsts,
470 AffineForOp replaceForOpWithNewYields(OpBuilder &b, AffineForOp loop,
482 AffineForOp getAffineForOp() { return op; } in getAffineForOp()
488 using operand_iterator = AffineForOp::operand_iterator;
489 using operand_range = AffineForOp::operand_range;
497 AffineForOp op;
504 AffineBound(AffineForOp op, unsigned opStart, unsigned opEnd, AffineMap map) in AffineBound()
507 friend class AffineForOp; variable
/llvm-project-15.0.7/mlir/include/mlir/Conversion/AffineToStandard/
H A DAffineToStandard.h15 class AffineForOp; variable
37 Value lowerAffineLowerBound(AffineForOp op, OpBuilder &builder);
41 Value lowerAffineUpperBound(AffineForOp op, OpBuilder &builder);
/llvm-project-15.0.7/mlir/lib/Dialect/Affine/IR/
H A DAffineOps.cpp1636 AffineForOp::getStepAttrStrName(), in parse()
1935 void AffineForOp::getSuccessorRegions( in getSuccessorRegions()
2069 AffineForOp::operand_range AffineForOp::getLowerBoundOperands() { in getLowerBoundOperands()
2073 AffineForOp::operand_range AffineForOp::getUpperBoundOperands() { in getUpperBoundOperands()
2079 AffineForOp::operand_range AffineForOp::getControlOperands() { in getControlOperands()
2136 return AffineForOp(); in getForInductionVarOwner()
2141 return AffineForOp(); in getForInductionVarOwner()
2196 static AffineForOp
2205 static AffineForOp
2235 AffineForOp mlir::replaceForOpWithNewYields(OpBuilder &b, AffineForOp loop, in replaceForOpWithNewYields()
[all …]

123