Lines Matching defs:forallOp

621 /// Promotes the loop body of a forallOp to its containing block if it can be
644 void mlir::scf::promote(RewriterBase &rewriter, scf::ForallOp forallOp) {
646 scf::InParallelOp terminator = forallOp.getTerminator();
650 SmallVector<Value> bbArgReplacements = forallOp.getLowerBound(rewriter);
651 bbArgReplacements.append(forallOp.getOutputs().begin(),
652 forallOp.getOutputs().end());
655 rewriter.inlineBlockBefore(forallOp.getBody(), forallOp->getBlock(),
656 forallOp->getIterator(), bbArgReplacements);
659 rewriter.setInsertionPointAfter(forallOp);
661 results.reserve(forallOp.getResults().size());
670 forallOp.getLoc(), dst.getType(), src, dst,
680 rewriter.replaceAllUsesWith(forallOp.getResults(), results);
684 rewriter.eraseOp(forallOp);
1463 auto forallOp = dimOp.getSource().getDefiningOp<ForallOp>();
1464 if (!forallOp)
1467 forallOp.getTiedOpOperand(llvm::cast<OpResult>(dimOp.getSource()))
1593 LogicalResult matchAndRewrite(ForallOp forallOp,
1612 for (OpResult result : forallOp.getResults()) {
1613 OpOperand *opOperand = forallOp.getTiedOpOperand(result);
1614 BlockArgument blockArg = forallOp.getTiedBlockArgument(opOperand);
1615 if (result.use_empty() || forallOp.getCombiningOps(blockArg).empty()) {
1634 OpOperand *opOperand = forallOp.getTiedOpOperand(result);
1635 BlockArgument blockArg = forallOp.getTiedBlockArgument(opOperand);
1637 forallOp.getCombiningOps(blockArg);
1645 forallOp.getLoc(), forallOp.getMixedLowerBound(),
1646 forallOp.getMixedUpperBound(), forallOp.getMixedStep(), newOuts,
1647 forallOp.getMapping(),
1652 Block *loopBody = forallOp.getBody();
1658 llvm::map_to_vector(newBbArgs.take_front(forallOp.getRank()),
1665 for (OpResult result : forallOp.getResults()) {
1667 newBlockArgs.push_back(forallOp.getTiedOpOperand(result)->get());
1685 forallOp.getTiedOpOperand(oldResult)->get());
1800 LogicalResult matchAndRewrite(scf::ForallOp forallOp,
1803 llvm::SmallVector<Value> newOutputTensors = forallOp.getOutputs();
1825 Location loc = forallOp.getLoc();
1827 loc, forallOp.getMixedLowerBound(), forallOp.getMixedUpperBound(),
1828 forallOp.getMixedStep(), newOutputTensors, forallOp.getMapping(),
1831 llvm::to_vector(bbArgs.take_back(forallOp->getNumResults()));
1840 llvm::to_vector(bbArgs.take_front(forallOp.getRank()));
1842 rewriter.mergeBlocks(forallOp.getBody(),
1864 rewriter.replaceOp(forallOp, castResults);
1905 scf::ForallOp forallOp =
1907 if (!forallOp)
1919 ArrayRef<BlockArgument> regionOutArgs = forallOp.getRegionOutArgs();