MLIR  16.0.0git
Macros | Functions
AffineAnalysis.cpp File Reference
#include "mlir/Dialect/Affine/Analysis/AffineAnalysis.h"
#include "mlir/Analysis/SliceAnalysis.h"
#include "mlir/Dialect/Affine/Analysis/LoopAnalysis.h"
#include "mlir/Dialect/Affine/Analysis/Utils.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Affine/IR/AffineValueMap.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/IR/AffineExprVisitor.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/IntegerSet.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "mlir/Interfaces/ViewLikeInterface.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
+ Include dependency graph for AffineAnalysis.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "affine-analysis"
 

Functions

static Value getSupportedReduction (AffineForOp forOp, unsigned pos, arith::AtomicRMWKind &kind)
 Get the value that is being reduced by pos-th reduction in the loop if such a reduction can be performed by affine parallel loops. More...
 
static bool isLocallyDefined (Value v, Operation *enclosingOp)
 Returns true if v is allocated locally to enclosingOp – i.e., it is allocated by an operation nested within enclosingOp. More...
 
static LogicalResult getOpIndexSet (Operation *op, FlatAffineValueConstraints *indexSet)
 Computes the iteration domain for 'op' and populates 'indexSet', which encapsulates the constraints involving loops surrounding 'op' and potentially involving any Function symbols. More...
 
static unsigned getNumCommonLoops (const FlatAffineValueConstraints &srcDomain, const FlatAffineValueConstraints &dstDomain, SmallVectorImpl< AffineForOp > *commonLoops=nullptr)
 
static BlockgetCommonBlock (Operation *opA, Operation *opB)
 Returns the closest surrounding block common to opA and opB. More...
 
static bool srcAppearsBeforeDstInAncestralBlock (const MemRefAccess &srcAccess, const MemRefAccess &dstAccess)
 Returns true if the ancestor operation of 'srcAccess' appears before the ancestor operation of 'dstAccess' in their common ancestral block. More...
 
static void addOrderingConstraints (const FlatAffineValueConstraints &srcDomain, const FlatAffineValueConstraints &dstDomain, unsigned loopDepth, FlatAffineValueConstraints *dependenceDomain)
 
static void computeDirectionVector (const FlatAffineValueConstraints &srcDomain, const FlatAffineValueConstraints &dstDomain, unsigned loopDepth, FlatAffineValueConstraints *dependenceDomain, SmallVector< DependenceComponent, 2 > *dependenceComponents)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "affine-analysis"

Definition at line 30 of file AffineAnalysis.cpp.

Function Documentation

◆ addOrderingConstraints()

static void addOrderingConstraints ( const FlatAffineValueConstraints srcDomain,
const FlatAffineValueConstraints dstDomain,
unsigned  loopDepth,
FlatAffineValueConstraints dependenceDomain 
)
static

◆ computeDirectionVector()

static void computeDirectionVector ( const FlatAffineValueConstraints srcDomain,
const FlatAffineValueConstraints dstDomain,
unsigned  loopDepth,
FlatAffineValueConstraints dependenceDomain,
SmallVector< DependenceComponent, 2 > *  dependenceComponents 
)
static

◆ getCommonBlock()

static Block* getCommonBlock ( Operation opA,
Operation opB 
)
static

Returns the closest surrounding block common to opA and opB.

opA and opB should be in the same affine scope and thus such a block is guaranteed to exist.

Definition at line 305 of file AffineAnalysis.cpp.

References mlir::Operation::getBlock(), mlir::Block::getParentOp(), mlir::Operation::hasTrait(), and mlir::Block::push_back().

Referenced by srcAppearsBeforeDstInAncestralBlock().

◆ getNumCommonLoops()

static unsigned getNumCommonLoops ( const FlatAffineValueConstraints srcDomain,
const FlatAffineValueConstraints dstDomain,
SmallVectorImpl< AffineForOp > *  commonLoops = nullptr 
)
static

◆ getOpIndexSet()

static LogicalResult getOpIndexSet ( Operation op,
FlatAffineValueConstraints indexSet 
)
static

Computes the iteration domain for 'op' and populates 'indexSet', which encapsulates the constraints involving loops surrounding 'op' and potentially involving any Function symbols.

The dimensional variables in 'indexSet' correspond to the loops surrounding 'op' from outermost to innermost.

Definition at line 271 of file AffineAnalysis.cpp.

References mlir::getEnclosingAffineForAndIfOps(), and mlir::getIndexSet().

Referenced by mlir::MemRefAccess::getAccessRelation().

◆ getSupportedReduction()

static Value getSupportedReduction ( AffineForOp  forOp,
unsigned  pos,
arith::AtomicRMWKind &  kind 
)
static

Get the value that is being reduced by pos-th reduction in the loop if such a reduction can be performed by affine parallel loops.

This assumes floating-point operations are commutative. On success, kind will be the reduction kind suitable for use in affine parallel loop builder. If the reduction is not supported, returns null.

Definition at line 40 of file AffineAnalysis.cpp.

◆ isLocallyDefined()

static bool isLocallyDefined ( Value  v,
Operation enclosingOp 
)
static

Returns true if v is allocated locally to enclosingOp – i.e., it is allocated by an operation nested within enclosingOp.

Definition at line 120 of file AffineAnalysis.cpp.

References mlir::Value::getDefiningOp(), and mlir::Operation::isProperAncestor().

Referenced by mlir::isLoopMemoryParallel().

◆ srcAppearsBeforeDstInAncestralBlock()

static bool srcAppearsBeforeDstInAncestralBlock ( const MemRefAccess srcAccess,
const MemRefAccess dstAccess 
)
static

Returns true if the ancestor operation of 'srcAccess' appears before the ancestor operation of 'dstAccess' in their common ancestral block.

The operations for srcAccess and dstAccess are expected to be in the same affine scope.

Definition at line 342 of file AffineAnalysis.cpp.

References getCommonBlock(), and mlir::MemRefAccess::opInst.

Referenced by mlir::checkMemrefAccessDependence().