Lines Matching defs:forOp
46 void runOnAffineForOp(AffineForOp forOp);
77 static bool doubleBuffer(Value oldMemRef, AffineForOp forOp) {
78 auto *forBody = forOp.getBody();
94 // The double buffer is allocated right before 'forOp'.
95 OpBuilder bOuter(forOp);
101 forOp.getLoc(), oldMemRef, dim.index()));
106 forOp.getLoc(), newMemRefType, allocOperands);
110 int64_t step = forOp.getStepAsInt();
113 auto ivModTwoOp = bInner.create<AffineApplyOp>(forOp.getLoc(), modTwoMap,
114 forOp.getInductionVar());
116 // replaceAllMemRefUsesWith will succeed unless the forOp body has
124 /*domOpFilter=*/&*forOp.getBody()->begin()))) {
126 forOp.emitError("memref replacement for double buffering failed"));
131 bOuter.setInsertionPointAfter(forOp);
132 bOuter.create<memref::DeallocOp>(forOp.getLoc(), newMemRef);
145 getOperation().walk([&](AffineForOp forOp) { forOps.push_back(forOp); });
146 for (auto forOp : forOps)
147 runOnAffineForOp(forOp);
175 AffineForOp forOp,
180 for (auto &op : *forOp.getBody()) {
187 for (auto &op : *forOp.getBody()) {
220 if (!forOp.getBody()->findAncestorOpInBlock(*user)) {
244 /// 'forOp' is deleted, and a prologue, a new pipelined loop, and epilogue are
246 void PipelineDataTransfer::runOnAffineForOp(AffineForOp forOp) {
247 auto mayBeConstTripCount = getConstantTripCount(forOp);
249 LLVM_DEBUG(forOp.emitRemark("won't pipeline due to unknown trip count"));
254 findMatchingStartFinishInsts(forOp, startWaitPairs);
257 LLVM_DEBUG(forOp.emitRemark("No dma start/finish pairs\n"));
273 if (!doubleBuffer(oldMemRef, forOp)) {
304 if (!doubleBuffer(oldTagMemRef, forOp)) {
325 findMatchingStartFinishInsts(forOp, startWaitPairs);
352 for (auto &op : forOp.getBody()->without_terminator())
356 SmallVector<uint64_t, 8> shifts(forOp.getBody()->getOperations().size());
358 for (auto &op : forOp.getBody()->without_terminator()) {
369 if (!isOpwiseShiftValid(forOp, shifts)) {
375 if (failed(affineForOpBodySkew(forOp, shifts))) {