Lines Matching refs:forOp

179 gatherLoadsAndStores(AffineForOp forOp,  in gatherLoadsAndStores()  argument
182 forOp.walk([&](Operation *op) { in gatherLoadsAndStores()
369 LogicalResult promoteSingleIterReductionLoop(AffineForOp forOp, in promoteSingleIterReductionLoop() argument
372 Optional<uint64_t> tripCount = getConstantTripCount(forOp); in promoteSingleIterReductionLoop()
375 auto iterOperands = forOp.getIterOperands(); in promoteSingleIterReductionLoop()
376 auto *parentOp = forOp->getParentOp(); in promoteSingleIterReductionLoop()
379 auto newOperands = forOp.getBody()->getTerminator()->getOperands(); in promoteSingleIterReductionLoop()
382 AffineForOp parentForOp = forOp->getParentOfType<AffineForOp>(); in promoteSingleIterReductionLoop()
384 b, parentForOp, iterOperands, newOperands, forOp.getRegionIterArgs()); in promoteSingleIterReductionLoop()
392 for (unsigned i = 0, e = forOp.getNumResults(); i != e; ++i) { in promoteSingleIterReductionLoop()
394 getForwardSlice(forOp.getResult(i), &tmpForwardSlice); in promoteSingleIterReductionLoop()
399 for (unsigned i = 0, e = forOp.getNumResults(); i != e; ++i) { in promoteSingleIterReductionLoop()
400 forOp.getResult(i).replaceAllUsesWith( in promoteSingleIterReductionLoop()
411 auto iv = forOp.getInductionVar(); in promoteSingleIterReductionLoop()
414 auto forOpIterArgs = forOp.getRegionIterArgs(); in promoteSingleIterReductionLoop()
421 forOp.getBody()->back().erase(); in promoteSingleIterReductionLoop()
422 auto *parentBlock = forOp->getBlock(); in promoteSingleIterReductionLoop()
423 parentBlock->getOperations().splice(Block::iterator(forOp), in promoteSingleIterReductionLoop()
424 forOp.getBody()->getOperations()); in promoteSingleIterReductionLoop()
425 forOp.erase(); in promoteSingleIterReductionLoop()
446 auto forOp = getForInductionVarOwner(loopIV); in fuseLoops() local
447 sliceLoops.push_back(forOp); in fuseLoops()
451 forOp.setLowerBound(lbOperands, lbMap); in fuseLoops()
456 forOp.setUpperBound(ubOperands, ubMap); in fuseLoops()
466 for (AffineForOp forOp : sliceLoops) { in fuseLoops() local
467 if (isLoopParallelAndContainsReduction(forOp) && in fuseLoops()
471 (void)promoteSingleIterReductionLoop(forOp, true); in fuseLoops()
474 (void)promoteIfSingleIteration(forOp); in fuseLoops()
482 auto walkResult = forOpRoot.walk([&](AffineForOp forOp) { in getLoopNestStats() argument
483 auto *childForOp = forOp.getOperation(); in getLoopNestStats()
484 auto *parentForOp = forOp->getParentOp(); in getLoopNestStats()
491 stats->loopMap[parentForOp].push_back(forOp); in getLoopNestStats()
497 for (auto &op : *forOp.getBody()) { in getLoopNestStats()
505 Optional<uint64_t> maybeConstTripCount = getConstantTripCount(forOp); in getLoopNestStats()
534 Operation *forOp, LoopNestStats &stats, in getComputeCostHelper() argument
539 int64_t opCount = stats.opCountMap[forOp] - 1; in getComputeCostHelper()
540 if (stats.loopMap.count(forOp) > 0) { in getComputeCostHelper()
541 for (auto childForOp : stats.loopMap[forOp]) { in getComputeCostHelper()
548 auto it = computeCostMap->find(forOp); in getComputeCostHelper()
554 int64_t tripCount = stats.tripCountMap[forOp]; in getComputeCostHelper()
556 auto it = tripCountOverrideMap->find(forOp); in getComputeCostHelper()
569 int64_t mlir::getComputeCost(AffineForOp forOp, LoopNestStats &stats) { in getComputeCost() argument
570 return getComputeCostHelper(forOp.getOperation(), stats, in getComputeCost()
622 if (auto forOp = in getFusionComputeCost() local
624 if (computeCostMap.count(forOp) == 0) in getFusionComputeCost()
625 computeCostMap[forOp] = 0; in getFusionComputeCost()
626 computeCostMap[forOp] -= 1; in getFusionComputeCost()