MLIR  20.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 "llvm/ADT/STLExtras.h"
#include <optional>

Go to the source code of this file.

Namespaces

 mlir
 Include the generated interface declarations.
 
 mlir::func
 

Typedefs

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 >
 

Functions

SmallVector< scf::ForOp > mlir::replaceLoopNestWithNewYields (RewriterBase &rewriter, MutableArrayRef< scf::ForOp > loopNest, ValueRange newIterOperands, const NewYieldValuesFn &newYieldValuesFn, bool replaceIterOperandsUsesInLoop=true)
 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...
 
std::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...
 
LogicalResult mlir::coalesceLoops (MutableArrayRef< scf::ForOp > loops)
 Replace a perfect nest of "for" loops with a single linearized loop. More...
 
LogicalResult mlir::coalesceLoops (RewriterBase &rewriter, MutableArrayRef< scf::ForOp >)
 
LogicalResult mlir::coalescePerfectlyNestedSCFForLoops (scf::ForOp op)
 Walk an affine.for to find a band to coalesce. More...
 
void mlir::collapseParallelLoops (RewriterBase &rewriter, 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::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...
 
LogicalResult mlir::loopUnrollJamByFactor (scf::ForOp forOp, uint64_t unrollFactor)
 Unrolls and jams this scf.for operation by the specified unroll factor. More...
 
Range mlir::emitNormalizedLoopBounds (RewriterBase &rewriter, Location loc, OpFoldResult lb, OpFoldResult ub, OpFoldResult step)
 Materialize bounds and step of a zero-based and unit-step loop derived by normalizing the specified bounds and step. More...
 
void mlir::denormalizeInductionVariable (RewriterBase &rewriter, Location loc, Value normalizedIv, OpFoldResult origLb, OpFoldResult origStep)
 Get back the original induction variable values after loop normalization. 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...
 
scf::ForallOp mlir::fuseIndependentSiblingForallLoops (scf::ForallOp target, scf::ForallOp source, RewriterBase &rewriter)
 Given two scf.forall loops, target and source, fuses target into source. More...
 
scf::ForOp mlir::fuseIndependentSiblingForLoops (scf::ForOp target, scf::ForOp source, RewriterBase &rewriter)
 Given two scf.for loops, target and source, fuses target into source. More...
 
FailureOr< scf::ForallOp > mlir::normalizeForallOp (RewriterBase &rewriter, scf::ForallOp forallOp)
 Normalize an scf.forall operation. More...