Home
last modified time | relevance | path

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

123

/external/llvm-project/mlir/include/mlir/Transforms/
DLoopUtils.h23 class AffineForOp; variable
39 LogicalResult loopUnrollFull(AffineForOp forOp);
44 LogicalResult loopUnrollByFactor(AffineForOp forOp, uint64_t unrollFactor);
49 LogicalResult loopUnrollUpToFactor(AffineForOp forOp, uint64_t unrollFactor);
53 bool LLVM_ATTRIBUTE_UNUSED isPerfectlyNested(ArrayRef<AffineForOp> loops);
59 void getPerfectlyNestedLoops(SmallVectorImpl<AffineForOp> &nestedLoops,
60 AffineForOp root);
66 LogicalResult loopUnrollJamByFactor(AffineForOp forOp,
71 LogicalResult loopUnrollJamUpToFactor(AffineForOp forOp,
76 LogicalResult promoteIfSingleIteration(AffineForOp forOp);
[all …]
DLoopFusionUtils.h24 class AffineForOp; variable
89 FusionResult canFuseLoops(AffineForOp srcForOp, AffineForOp dstForOp,
97 void fuseLoops(AffineForOp srcForOp, AffineForOp dstForOp,
105 DenseMap<Operation *, SmallVector<AffineForOp, 2>> loopMap;
116 bool getLoopNestStats(AffineForOp forOp, LoopNestStats *stats);
123 int64_t getComputeCost(AffineForOp forOp, LoopNestStats &stats);
132 bool getFusionComputeCost(AffineForOp srcForOp, LoopNestStats &srcStats,
133 AffineForOp dstForOp, LoopNestStats &dstStats,
/external/llvm-project/mlir/lib/Dialect/Affine/Transforms/
DLoopUnroll.cpp40 const std::function<unsigned(AffineForOp)> getUnrollFactor;
49 const std::function<unsigned(AffineForOp)> &getUnrollFactor = nullptr) in LoopUnroll()
60 LogicalResult runOnAffineForOp(AffineForOp forOp);
65 static bool isInnermostAffineForOp(AffineForOp forOp) { in isInnermostAffineForOp()
68 forOp.walk([&](AffineForOp thisForOp) { in isInnermostAffineForOp()
78 SmallVectorImpl<AffineForOp> &loops) { in gatherInnermostLoops()
79 f.walk([&](AffineForOp forOp) { in gatherInnermostLoops()
88 SmallVector<AffineForOp, 4> loops; in runOnFunction()
93 getFunction().walk([&](AffineForOp forOp) { in runOnFunction()
105 SmallVector<AffineForOp, 4> loops; in runOnFunction()
[all …]
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 runOnFunction()
180 SmallVector<AffineForOp, 6> tiledNest; in runOnFunction()
187 MutableArrayRef<AffineForOp>(tiledNest).drop_front(band.size()); in runOnFunction()
DSuperVectorize.cpp798 static LogicalResult vectorizeAffineForOp(AffineForOp loop, int64_t step, in vectorizeAffineForOp()
835 auto loop = cast<AffineForOp>(forOp); in isVectorizableLoopPtrFactory()
853 vectorizeLoopsAndLoads(std::vector<SmallVector<AffineForOp, 2>> &loops, in vectorizeLoopsAndLoads() argument
858 for (AffineForOp loop : loopsInLevel) { in vectorizeLoopsAndLoads()
926 auto loop = cast<AffineForOp>(loopToDim.first); in isUniformDefinition()
1143 std::vector<SmallVector<AffineForOp, 2>> &loops) { in getMatchedAffineLoopsRec() argument
1147 loops.push_back(SmallVector<AffineForOp, 2>()); in getMatchedAffineLoopsRec()
1150 loops[currentLevel].push_back(cast<AffineForOp>(match.getMatchedOperation())); in getMatchedAffineLoopsRec()
1163 std::vector<SmallVector<AffineForOp, 2>> &loops) { in getMatchedAffineLoops() argument
1170 vectorizeLoopNest(std::vector<SmallVector<AffineForOp, 2>> &loops, in vectorizeLoopNest() argument
[all …]
DAffineDataCopyGeneration.cpp123 return isa<AffineLoadOp, AffineStoreOp, AffineForOp>(op) && in runOnBlock()
130 AffineForOp forOp; in runOnBlock()
132 if ((forOp = dyn_cast<AffineForOp>(&*it)) && copyNests.count(forOp) == 0) { in runOnBlock()
138 auto exceedsCapacity = [&](AffineForOp forOp) { in runOnBlock()
173 return isa<AffineLoadOp, AffineStoreOp, AffineForOp>(op) && in runOnBlock()
219 if (auto forOp = dyn_cast<AffineForOp>(op)) in runOnFunction()
DAffineLoopInvariantCodeMotion.cpp47 void runOnAffineForOp(AffineForOp forOp);
79 } else if (isa<AffineForOp>(op)) { in isOpLoopInvariant()
109 SmallVector<AffineForOp, 8> userIVs; in isOpLoopInvariant()
191 void LoopInvariantCodeMotion::runOnAffineForOp(AffineForOp forOp) { in runOnAffineForOp()
204 if (!isa<AffineForOp>(op)) { in runOnAffineForOp()
226 getFunction().walk([&](AffineForOp op) { in runOnFunction()
DAffineParallelize.cpp43 std::deque<AffineForOp> parallelizableLoops; in runOnFunction()
44 f.walk([&](AffineForOp loop) { in runOnFunction()
49 for (AffineForOp loop : parallelizableLoops) { in runOnFunction()
/external/llvm-project/mlir/include/mlir/Analysis/
DLoopAnalysis.h23 class AffineForOp; variable
38 void buildTripCountMapAndOperands(AffineForOp forOp, AffineMap *map,
44 Optional<uint64_t> getConstantTripCount(AffineForOp forOp);
49 uint64_t getLargestDivisorOfTripCount(AffineForOp forOp);
63 using VectorizableLoopFun = std::function<bool(AffineForOp)>;
69 bool isVectorizableLoopBody(AffineForOp loop,
77 bool isVectorizableLoopBody(AffineForOp loop, int *memRefDim,
85 bool isOpwiseShiftValid(AffineForOp forOp, ArrayRef<uint64_t> shifts);
DUtils.h29 class AffineForOp; variable
40 void getLoopIVs(Operation &op, SmallVectorImpl<AffineForOp> *loops);
54 void getSequentialLoops(AffineForOp forOp,
165 AffineForOp insertBackwardComputationSlice(Operation *srcOpInst,
305 Optional<int64_t> getMemoryFootprintBytes(AffineForOp forOp,
309 bool isLoopParallel(AffineForOp forOp);
320 SmallVectorImpl<AffineForOp> *surroundingLoops = nullptr);
/external/tensorflow/tensorflow/compiler/mlir/xla/experimental/conv_emitter/
Dconv_emitter_transforms.h38 bool IsSimpleLoop(mlir::AffineForOp loop);
39 std::vector<mlir::AffineForOp> CreateNestedSimpleLoops(
41 void SetBoundForSimpleLoop(mlir::AffineForOp loop, mlir::AffineExpr new_bound,
91 mlir::AffineForOp TileLoop(mlir::AffineForOp loop, int64_t size,
92 mlir::AffineForOp target);
96 void SinkPerfectlyNestedLoops(llvm::MutableArrayRef<mlir::AffineForOp> loops,
Dconv_emitter_transforms.cc59 bool IsSimpleLoop(mlir::AffineForOp loop) { in IsSimpleLoop()
66 std::vector<mlir::AffineForOp> CreateNestedSimpleLoops( in CreateNestedSimpleLoops()
68 std::vector<mlir::AffineForOp> loops; in CreateNestedSimpleLoops()
72 builder.create<mlir::AffineForOp>(builder.getUnknownLoc(), 0, dim); in CreateNestedSimpleLoops()
79 void SetBoundForSimpleLoop(mlir::AffineForOp loop, mlir::AffineExpr new_bound, in SetBoundForSimpleLoop()
88 mlir::AffineForOp TileLoop(mlir::AffineForOp loop, int64_t size, in TileLoop()
89 mlir::AffineForOp target) { in TileLoop()
93 llvm::SmallVector<mlir::AffineForOp, 4> all_loops; in TileLoop()
101 builder.create<mlir::AffineForOp>(builder.getUnknownLoc(), 0, size); in TileLoop()
139 void SinkPerfectlyNestedLoops(llvm::MutableArrayRef<mlir::AffineForOp> loops, in SinkPerfectlyNestedLoops()
Dconv_emitter.cc136 mlir::AffineForOp where) { in HoistAndFix()
138 llvm::SmallVector<mlir::AffineForOp, 4> ancestors; in HoistAndFix()
197 if (mlir::isa<mlir::AffineForOp, mlir::AffineStoreOp>(op)) { in HoistAndFix()
206 std::vector<mlir::AffineForOp> new_loops; in HoistAndFix()
209 builder.create<mlir::AffineForOp>(builder.getUnknownLoc(), 0, dim); in HoistAndFix()
228 mlir::Operation* HoistAndFix(mlir::Operation* op, mlir::AffineForOp where) { in HoistAndFix()
233 std::vector<mlir::AffineForOp> cartesian_product_loops;
234 std::vector<mlir::AffineForOp> reduction_loops;
258 std::vector<mlir::AffineForOp> cartesian_product_loops = in CreateNaiveMlirConv()
273 std::vector<mlir::AffineForOp> reduction_loops; in CreateNaiveMlirConv()
[all …]
/external/llvm-project/mlir/test/lib/Transforms/
DTestAffineLoopParametricTiling.cpp32 static void checkIfTilingParametersExist(ArrayRef<AffineForOp> band) { in checkIfTilingParametersExist()
34 AffineForOp topLoop = band[0]; in checkIfTilingParametersExist()
44 static void getTilingParameters(ArrayRef<AffineForOp> band, in getTilingParameters()
46 AffineForOp topLoop = band[0]; in getTilingParameters()
62 std::vector<SmallVector<AffineForOp, 6>> bands; in runOnFunction()
66 for (SmallVectorImpl<AffineForOp> &band : bands) { in runOnFunction()
69 SmallVector<AffineForOp, 6> tiledNest; in runOnFunction()
DTestLoopFusion.cpp54 static bool testDependenceCheck(AffineForOp srcForOp, AffineForOp dstForOp, in testDependenceCheck()
106 static bool testSliceComputation(AffineForOp forOpA, AffineForOp forOpB, in testSliceComputation()
124 static bool testLoopFusionTransformation(AffineForOp forOpA, AffineForOp forOpB, in testLoopFusionTransformation()
143 using LoopFunc = function_ref<bool(AffineForOp, AffineForOp, unsigned, unsigned,
149 static bool iterateLoops(ArrayRef<SmallVector<AffineForOp, 2>> depthToLoops, in iterateLoops() argument
170 std::vector<SmallVector<AffineForOp, 2>> depthToLoops; in runOnFunction()
/external/llvm-project/mlir/lib/Transforms/Utils/
DLoopFusionUtils.cpp117 SmallVector<AffineForOp, 4> loops; in getLastDependentOpInRange()
120 if (llvm::is_contained(loops, cast<AffineForOp>(opB))) { in getLastDependentOpInRange()
137 static Operation *getFusedLoopNestInsertionPoint(AffineForOp srcForOp, in getFusedLoopNestInsertionPoint()
138 AffineForOp dstForOp) { in getFusedLoopNestInsertionPoint()
178 gatherLoadsAndStores(AffineForOp forOp, in gatherLoadsAndStores()
263 FusionResult mlir::canFuseLoops(AffineForOp srcForOp, AffineForOp dstForOp, in canFuseLoops()
367 void mlir::fuseLoops(AffineForOp srcForOp, AffineForOp dstForOp, in fuseLoops()
375 SmallVector<AffineForOp, 4> sliceLoops; in fuseLoops()
395 for (AffineForOp forOp : sliceLoops) in fuseLoops()
402 bool mlir::getLoopNestStats(AffineForOp forOpRoot, LoopNestStats *stats) { in getLoopNestStats()
[all …]
DLoopUtils.cpp58 static void getCleanupLoopLowerBound(AffineForOp forOp, unsigned unrollFactor, in getCleanupLoopLowerBound()
153 LogicalResult mlir::promoteIfSingleIteration(AffineForOp forOp) { in promoteIfSingleIteration()
236 if (auto forOp = dyn_cast<AffineForOp>(op)) in promoteSingleIterationLoops()
250 static AffineForOp generateShiftedLoop( in generateShiftedLoop()
253 unsigned offset, AffineForOp srcForOp, OpBuilder b) { in generateShiftedLoop()
260 auto loopChunk = b.create<AffineForOp>(srcForOp.getLoc(), lbOperands, lbMap, in generateShiftedLoop()
290 return AffineForOp(); in generateShiftedLoop()
305 LogicalResult mlir::affineForOpBodySkew(AffineForOp forOp, in affineForOpBodySkew()
354 AffineForOp prologue, epilogue; in affineForOpBodySkew()
374 AffineForOp res; in affineForOpBodySkew()
[all …]
/external/llvm-project/mlir/lib/Conversion/SCFToGPU/
DSCFToGPU.cpp55 static Operation::operand_range getLowerBoundOperands(AffineForOp forOp) { in getLowerBoundOperands()
60 static Operation::operand_range getUpperBoundOperands(AffineForOp forOp) { in getUpperBoundOperands()
66 static Value getOrCreateStep(AffineForOp forOp, OpBuilder &builder) { in getOrCreateStep()
72 static Value getOrEmitLowerBound(AffineForOp forOp, OpBuilder &builder) { in getOrEmitLowerBound()
78 static Value getOrEmitUpperBound(AffineForOp forOp, OpBuilder &builder) { in getOrEmitUpperBound()
88 static LogicalResult checkAffineLoopNestMappableImpl(AffineForOp forOp, in checkAffineLoopNestMappableImpl()
108 if (!(forOp = dyn_cast<AffineForOp>(nested))) in checkAffineLoopNestMappableImpl()
114 static LogicalResult checkAffineLoopNestMappable(AffineForOp forOp, in checkAffineLoopNestMappable()
135 Optional<AffineForOp> collectBounds(AffineForOp forOp, unsigned numLoops);
137 void createLaunch(AffineForOp rootForOp, AffineForOp innermostForOp,
[all …]
/external/llvm-project/mlir/lib/Analysis/
DLoopAnalysis.cpp34 AffineForOp forOp, AffineMap *tripCountMap, in buildTripCountMapAndOperands()
87 Optional<uint64_t> mlir::getConstantTripCount(AffineForOp forOp) { in getConstantTripCount()
113 uint64_t mlir::getLargestDivisorOfTripCount(AffineForOp forOp) { in getLargestDivisorOfTripCount()
275 using VectorizableOpFun = std::function<bool(AffineForOp, Operation &)>;
278 isVectorizableLoopBodyWithOpCond(AffineForOp loop, in isVectorizableLoopBodyWithOpCond()
293 return op.getNumRegions() != 0 && !isa<AffineIfOp, AffineForOp>(op); in isVectorizableLoopBodyWithOpCond()
328 bool mlir::isVectorizableLoopBody(AffineForOp loop, int *memRefDim, in isVectorizableLoopBody()
330 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()
DUtils.cpp33 void mlir::getLoopIVs(Operation &op, SmallVectorImpl<AffineForOp> *loops) { in getLoopIVs()
35 AffineForOp currAffineForOp; in getLoopIVs()
38 while (currOp && ((currAffineForOp = dyn_cast<AffineForOp>(currOp)) || in getLoopIVs()
57 while (currOp && (isa<AffineIfOp, AffineForOp>(currOp))) { in getEnclosingAffineForAndIfOps()
252 SmallVector<AffineForOp, 4> ivs; in compute()
346 SmallVector<AffineForOp, 4> enclosingIVs; in compute()
353 AffineForOp iv; in compute()
537 if (auto childAffineForOp = dyn_cast<AffineForOp>(op)) in getInstAtPosition()
569 ArrayRef<Operation *> ops, SmallVectorImpl<AffineForOp> *surroundingLoops) { in getInnermostCommonLoopDepth()
573 std::vector<SmallVector<AffineForOp, 4>> loops(numOps); in getInnermostCommonLoopDepth()
[all …]
/external/llvm-project/mlir/include/mlir/Dialect/Affine/
DUtils.h22 class AffineForOp; variable
31 void affineParallelize(AffineForOp forOp);
125 vectorizeAffineLoopNest(std::vector<SmallVector<AffineForOp, 2>> &loops,
/external/llvm-project/mlir/include/mlir/Conversion/AffineToStandard/
DAffineToStandard.h16 class AffineForOp; variable
56 Value lowerAffineLowerBound(AffineForOp op, OpBuilder &builder);
60 Value lowerAffineUpperBound(AffineForOp op, OpBuilder &builder);
/external/llvm-project/mlir/include/mlir/Dialect/Affine/IR/
DAffineOps.h386 AffineForOp getForInductionVarOwner(Value val);
390 void extractForInductionVars(ArrayRef<AffineForOp> forInsts,
414 AffineForOp getAffineForOp() { return op; } in getAffineForOp()
420 using operand_iterator = AffineForOp::operand_iterator;
421 using operand_range = AffineForOp::operand_range;
429 AffineForOp op;
436 AffineBound(AffineForOp op, unsigned opStart, unsigned opEnd, AffineMap map) in AffineBound()
439 friend class AffineForOp; variable
/external/llvm-project/mlir/lib/Transforms/
DLoopFusion.cpp82 SmallVector<AffineForOp, 4> forOps;
89 if (isa<AffineForOp>(op)) in collect()
90 forOps.push_back(cast<AffineForOp>(op)); in collect()
219 Node *getForOpNode(AffineForOp forOp) { in getForOpNode()
600 if (!isa<AffineForOp>(getNode(edge.id)->op)) in forEachMemRefEdge()
642 if (auto forOp = dyn_cast<AffineForOp>(op)) { in init()
698 SmallVector<AffineForOp, 4> loops; in init()
750 assert(isa<AffineForOp>(node->op)); in sinkSequentialLoops()
751 AffineForOp newRootForOp = sinkSequentialLoops(cast<AffineForOp>(node->op)); in sinkSequentialLoops()
775 static Value createPrivateMemRef(AffineForOp forOp, Operation *srcStoreOpInst, in createPrivateMemRef()
[all …]
/external/llvm-project/mlir/lib/Dialect/Affine/IR/
DAffineOps.cpp144 isa<AffineForOp, AffineParallelOp>(parentOp)); in isValidDim()
166 return isa<AffineForOp, AffineParallelOp>(parentOp); in isValidDim()
1210 void AffineForOp::build(OpBuilder &builder, OperationState &result, in build()
1260 void AffineForOp::build(OpBuilder &builder, OperationState &result, int64_t lb, in build()
1269 static LogicalResult verify(AffineForOp op) { in verify()
1318 auto boundAttrName = isLower ? AffineForOp::getLowerBoundAttrName() in parseBound()
1319 : AffineForOp::getUpperBoundAttrName(); in parseBound()
1418 AffineForOp::getStepAttrName(), in parseAffineForOp()
1424 AffineForOp::getStepAttrName().data(), in parseAffineForOp()
1464 AffineForOp::ensureTerminator(*body, builder, result.location); in parseAffineForOp()
[all …]

123