MLIR  19.0.0git
Classes | Namespaces | Functions
Utils.h File Reference
#include "mlir/Dialect/Affine/Analysis/AffineStructures.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include <memory>
#include <optional>

Go to the source code of this file.

Classes

struct  mlir::affine::LoopNestStateCollector
 
struct  mlir::affine::MemRefDependenceGraph
 
struct  mlir::affine::MemRefDependenceGraph::Node
 
struct  mlir::affine::MemRefDependenceGraph::Edge
 
struct  mlir::affine::SliceComputationResult
 Enumerates different result statuses of slice computation by computeSliceUnion More...
 
struct  mlir::affine::ComputationSliceState
 ComputationSliceState aggregates loop IVs, loop bound AffineMaps and their associated operands for a set of loops within a loop nest (typically the set of loops surrounding a store operation). More...
 
struct  mlir::affine::MemRefRegion
 A region of a memref's data space; this is typically constructed by analyzing load/store op's on this memref and the index space of loops surrounding such op's. More...
 

Namespaces

 mlir
 Include the generated interface declarations.
 
 mlir::affine
 

Functions

void mlir::affine::getAffineForIVs (Operation &op, SmallVectorImpl< AffineForOp > *loops)
 Populates 'loops' with IVs of the affine.for ops surrounding 'op' ordered from the outermost 'affine.for' operation to the innermost one while not traversing outside of the surrounding affine scope. More...
 
void mlir::affine::getAffineIVs (Operation &op, SmallVectorImpl< Value > &ivs)
 Populates 'ivs' with IVs of the surrounding affine.for and affine.parallel ops ordered from the outermost one to the innermost while not traversing outside of the surrounding affine scope. More...
 
void mlir::affine::getEnclosingAffineOps (Operation &op, SmallVectorImpl< Operation * > *ops)
 Populates 'ops' with affine operations enclosing op ordered from outermost to innermost while stopping at the boundary of the affine scope. More...
 
unsigned mlir::affine::getNestingDepth (Operation *op)
 Returns the nesting depth of this operation, i.e., the number of loops surrounding this operation. More...
 
bool mlir::affine::isLoopParallelAndContainsReduction (AffineForOp forOp)
 Returns whether a loop is a parallel loop and contains a reduction loop. More...
 
void mlir::affine::getSequentialLoops (AffineForOp forOp, llvm::SmallDenseSet< Value, 8 > *sequentialLoops)
 Returns in 'sequentialLoops' all sequential loops in loop nest rooted at 'forOp'. More...
 
void mlir::affine::getComputationSliceState (Operation *depSourceOp, Operation *depSinkOp, FlatAffineValueConstraints *dependenceConstraints, unsigned loopDepth, bool isBackwardSlice, ComputationSliceState *sliceState)
 Computes the computation slice loop bounds for one loop nest as affine maps of the other loop nest's IVs and symbols, using 'dependenceConstraints' computed between 'depSourceAccess' and 'depSinkAccess'. More...
 
uint64_t mlir::affine::getSliceIterationCount (const llvm::SmallDenseMap< Operation *, uint64_t, 8 > &sliceTripCountMap)
 Return the number of iterations for the slicetripCountMap provided. More...
 
bool mlir::affine::buildSliceTripCountMap (const ComputationSliceState &slice, llvm::SmallDenseMap< Operation *, uint64_t, 8 > *tripCountMap)
 Builds a map 'tripCountMap' from AffineForOp to constant trip count for loop nest surrounding represented by slice loop bounds in 'slice'. More...
 
SliceComputationResult mlir::affine::computeSliceUnion (ArrayRef< Operation * > opsA, ArrayRef< Operation * > opsB, unsigned loopDepth, unsigned numCommonLoops, bool isBackwardSlice, ComputationSliceState *sliceUnion)
 Computes in 'sliceUnion' the union of all slice bounds computed at 'loopDepth' between all dependent pairs of ops in 'opsA' and 'opsB', and then verifies if it is valid. More...
 
AffineForOp mlir::affine::insertBackwardComputationSlice (Operation *srcOpInst, Operation *dstOpInst, unsigned dstLoopDepth, ComputationSliceState *sliceState)
 Creates a clone of the computation contained in the loop nest surrounding 'srcOpInst', slices the iteration space of src loop based on slice bounds in 'sliceState', and inserts the computation slice at the beginning of the operation block of the loop at 'dstLoopDepth' in the loop nest surrounding 'dstOpInst'. More...
 
std::optional< uint64_t > mlir::affine::getIntOrFloatMemRefSizeInBytes (MemRefType memRefType)
 Returns the size of a memref with element type int or float in bytes if it's statically shaped, std::nullopt otherwise. More...
 
template<typename LoadOrStoreOpPointer >
LogicalResult mlir::affine::boundCheckLoadOrStoreOp (LoadOrStoreOpPointer loadOrStoreOp, bool emitError=true)
 Checks a load or store op for an out of bound access; returns failure if the access is out of bounds along any of the dimensions, success otherwise. More...
 
unsigned mlir::affine::getNumCommonSurroundingLoops (Operation &a, Operation &b)
 Returns the number of surrounding loops common to both A and B. More...
 
std::optional< int64_t > mlir::affine::getMemoryFootprintBytes (AffineForOp forOp, int memorySpace=-1)
 Gets the memory footprint of all data touched in the specified memory space in bytes; if the memory space is unspecified, considers all memory spaces. More...
 
std::optional< int64_t > mlir::affine::getMemRefIntOrFloatEltSizeInBytes (MemRefType memRefType)
 Returns the memref's element type's size in bytes where the elemental type is an int or float or a vector of such types. More...
 
IntegerSet mlir::affine::simplifyIntegerSet (IntegerSet set)
 Simplify the integer set by simplifying the underlying affine expressions by flattening and some simple inference. More...
 
unsigned mlir::affine::getInnermostCommonLoopDepth (ArrayRef< Operation * > ops, SmallVectorImpl< AffineForOp > *surroundingLoops=nullptr)
 Returns the innermost common loop depth for the set of operations in 'ops'. More...
 
FailureOr< AffineValueMapmlir::affine::simplifyConstrainedMinMaxOp (Operation *op, FlatAffineValueConstraints constraints)
 Try to simplify the given affine.min or affine.max op to an affine map with a single result and operands, taking into account the specified constraint set. More...