MLIR  16.0.0git
Classes | Namespaces | Typedefs | Functions
Utils.h File Reference
#include "mlir/Dialect/Affine/Analysis/AffineAnalysis.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.

Classes

struct  mlir::VectorizationStrategy
 Holds parameters to perform n-D vectorization on a single loop nest. More...
 
struct  mlir::DivModValue
 Holds the result of (div a, b) and (mod a, b). More...
 

Namespaces

 mlir
 Include the generated interface declarations.
 
 mlir::func
 
 mlir::memref
 

Typedefs

using mlir::ReductionLoopMap = DenseMap< Operation *, SmallVector< LoopReduction, 2 > >
 

Functions

LogicalResult mlir::affineParallelize (AffineForOp forOp, ArrayRef< LoopReduction > parallelReductions={})
 Replaces a parallel affine.for op with a 1-d affine.parallel op. More...
 
LogicalResult mlir::hoistAffineIfOp (AffineIfOp ifOp, bool *folded=nullptr)
 Hoists out affine.if/else to as high as possible, i.e., past all invariant affine.fors/parallel's. More...
 
void mlir::affineScalarReplace (func::FuncOp f, DominanceInfo &domInfo, PostDominanceInfo &postDomInfo)
 Replace affine store and load accesses by scalars by forwarding stores to loads and eliminate invariant affine loads; consequently, eliminate dead allocs. More...
 
void mlir::vectorizeAffineLoops (Operation *parentOp, llvm::DenseSet< Operation *, DenseMapInfo< Operation *>> &loops, ArrayRef< int64_t > vectorSizes, ArrayRef< int64_t > fastestVaryingPattern, const ReductionLoopMap &reductionLoops=ReductionLoopMap())
 Vectorizes affine loops in 'loops' using the n-D vectorization factors in 'vectorSizes'. More...
 
LogicalResult mlir::vectorizeAffineLoopNest (std::vector< SmallVector< AffineForOp, 2 >> &loops, const VectorizationStrategy &strategy)
 External utility to vectorize affine loops from a single loop nest using an n-D vectorization strategy (see doc in VectorizationStrategy definition). More...
 
void mlir::normalizeAffineParallel (AffineParallelOp op)
 Normalize a affine.parallel op so that lower bounds are 0 and steps are 1. More...
 
LogicalResult mlir::normalizeAffineFor (AffineForOp op)
 Normalize an affine.for op. More...
 
AffineExpr mlir::substWithMin (AffineExpr e, AffineExpr dim, AffineExpr min, AffineExpr max, bool positivePath=true)
 Traverse e and return an AffineExpr where all occurrences of dim have been replaced by either: More...
 
LogicalResult mlir::replaceAllMemRefUsesWith (Value oldMemRef, Value newMemRef, ArrayRef< Value > extraIndices={}, AffineMap indexRemap=AffineMap(), ArrayRef< Value > extraOperands={}, ArrayRef< Value > symbolOperands={}, Operation *domOpFilter=nullptr, Operation *postDomOpFilter=nullptr, bool allowNonDereferencingOps=false, bool replaceInDeallocOp=false)
 Replaces all "dereferencing" uses of oldMemRef with newMemRef while optionally remapping the old memref's indices using the supplied affine map, indexRemap. More...
 
LogicalResult mlir::replaceAllMemRefUsesWith (Value oldMemRef, Value newMemRef, Operation *op, ArrayRef< Value > extraIndices={}, AffineMap indexRemap=AffineMap(), ArrayRef< Value > extraOperands={}, ArrayRef< Value > symbolOperands={}, bool allowNonDereferencingOps=false)
 Performs the same replacement as the other version above but only for the dereferencing uses of oldMemRef in op, except in cases where 'allowNonDereferencingOps' is set to true where we replace the non-dereferencing uses as well. More...
 
LogicalResult mlir::normalizeMemRef (memref::AllocOp *op)
 Rewrites the memref defined by this alloc op to have an identity layout map and updates all its indexing uses. More...
 
MemRefType mlir::normalizeMemRefType (MemRefType memrefType, OpBuilder builder, unsigned numSymbolicOperands)
 Uses the old memref type map layout and computes the new memref type to have a new shape and a layout map, where the old layout map has been normalized to an identity layout map. More...
 
Operation * mlir::createComposedAffineApplyOp (OpBuilder &builder, Location loc, ArrayRef< Value > operands, ArrayRef< Operation *> affineApplyOps, SmallVectorImpl< Value > *results)
 Creates and inserts into 'builder' a new AffineApplyOp, with the number of its results equal to the number of operands, as a composition of all other AffineApplyOps reachable from input parameter 'operands'. More...
 
void mlir::createAffineComputationSlice (Operation *opInst, SmallVectorImpl< AffineApplyOp > *sliceOps)
 Given an operation, inserts one or more single result affine apply operations, results of which are exclusively used by this operation. More...
 
Value mlir::expandAffineExpr (OpBuilder &builder, Location loc, AffineExpr expr, ValueRange dimValues, ValueRange symbolValues)
 Emit code that computes the given affine expression using standard arithmetic operations applied to the provided dimension and symbol values. More...
 
Optional< SmallVector< Value, 8 > > mlir::expandAffineMap (OpBuilder &builder, Location loc, AffineMap affineMap, ValueRange operands)
 Create a sequence of operations that implement the affineMap applied to the given operands (as it it were an AffineApplyOp). More...
 
DivModValue mlir::getDivMod (OpBuilder &b, Location loc, Value lhs, Value rhs)
 Create IR to calculate (div lhs, rhs) and (mod lhs, rhs). More...
 
FailureOr< SmallVector< Value > > mlir::delinearizeIndex (OpBuilder &b, Location loc, Value linearIndex, ArrayRef< Value > basis)
 Generate the IR to delinearize linearIndex given the basis and return the multi-index. More...