MLIR  16.0.0git
Namespaces | Typedefs | Functions
Utils.h File Reference
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Support/LogicalResult.h"
#include "llvm/ADT/STLExtras.h"
+ Include dependency graph for Utils.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


 Include the generated interface declarations.


using mlir::NewYieldValueFn = std::function< SmallVector< Value >(OpBuilder &b, Location loc, ArrayRef< BlockArgument > newBBArgs)>
 Replace the loop with newIterOperands added as new initialization values. More...
using mlir::Loops = SmallVector< scf::ForOp, 8 >
 Tile a nest of standard for loops rooted at rootForOp by finding such parametric tile sizes that the outer loops have a fixed number of iterations as defined in sizes. More...
using mlir::TileLoops = std::pair< Loops, Loops >


scf::ForOp mlir::replaceLoopWithNewYields (OpBuilder &builder, scf::ForOp loop, ValueRange newIterOperands, const NewYieldValueFn &newYieldValuesFn)
SmallVector< scf::ForOp > mlir::replaceLoopNestWithNewYields (OpBuilder &builder, ArrayRef< scf::ForOp > loopNest, ValueRange newIterOperands, NewYieldValueFn newYieldValueFn)
 Update a perfectly nested loop nest to yield new values from the innermost loop and propagating it up through the loop nest. More...
FailureOr< func::FuncOp > mlir::outlineSingleBlockRegion (RewriterBase &rewriter, Location loc, Region &region, StringRef funcName, func::CallOp *callOp=nullptr)
 Outline a region with a single block into a new FuncOp. More...
LogicalResult mlir::outlineIfOp (RewriterBase &b, scf::IfOp ifOp, func::FuncOp *thenFn, StringRef thenFnName, func::FuncOp *elseFn, StringRef elseFnName)
 Outline the then and/or else regions of ifOp as follows: More...
bool mlir::getInnermostParallelLoops (Operation *rootOp, SmallVectorImpl< scf::ParallelOp > &result)
 Get a list of innermost parallel loops contained in rootOp. More...
Optional< std::pair< AffineExpr, AffineExpr > > mlir::getSCFMinMaxExpr (Value value, SmallVectorImpl< Value > &dims, SmallVectorImpl< Value > &symbols, llvm::function_ref< bool(Operation *)> loopFilter=nullptr)
 Return the min/max expressions for value if it is an induction variable from scf.for or scf.parallel loop. More...
void mlir::coalesceLoops (MutableArrayRef< scf::ForOp > loops)
 Replace a perfect nest of "for" loops with a single linearized loop. More...
void mlir::collapseParallelLoops (scf::ParallelOp loops, ArrayRef< std::vector< unsigned >> combinedDimensions)
 Take the ParallelLoop and for each set of dimension indices, combine them into a single dimension. More...
LogicalResult mlir::promoteIfSingleIteration (scf::ForOp forOp)
 Promotes the loop body of a scf::ForOp to its containing block if the loop was known to have a single iteration. More...
LogicalResult mlir::loopUnrollByFactor (scf::ForOp forOp, uint64_t unrollFactor, function_ref< void(unsigned, Operation *, OpBuilder)> annotateFn=nullptr)
 Unrolls this for operation by the specified unroll factor. More...
TileLoops mlir::extractFixedOuterLoops (scf::ForOp rootFOrOp, ArrayRef< int64_t > sizes)
SmallVector< Loops, 8 > mlir::tile (ArrayRef< scf::ForOp > forOps, ArrayRef< Value > sizes, ArrayRef< scf::ForOp > targets)
 Performs tiling fo imperfectly nested loops (with interchange) by strip-mining the forOps by sizes and sinking them, in their order of occurrence in forOps, under each of the targets. More...
Loops mlir::tile (ArrayRef< scf::ForOp > forOps, ArrayRef< Value > sizes, scf::ForOp target)
 Performs tiling (with interchange) by strip-mining the forOps by sizes and sinking them, in their order of occurrence in forOps, under target. More...
Loops mlir::tilePerfectlyNested (scf::ForOp rootForOp, ArrayRef< Value > sizes)
 Tile a nest of scf::ForOp loops rooted at rootForOp with the given (parametric) sizes. More...
void mlir::getPerfectlyNestedLoops (SmallVectorImpl< scf::ForOp > &nestedLoops, scf::ForOp root)
 Get perfectly nested sequence of loops starting at root of loop nest (the first op being another AffineFor, and the second op - a terminator). More...