MLIR
16.0.0git
|
#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"
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 Block * | getCommonBlock (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) |
#define DEBUG_TYPE "affine-analysis" |
Definition at line 30 of file AffineAnalysis.cpp.
|
static |
Definition at line 365 of file AffineAnalysis.cpp.
References mlir::presburger::IntegerRelation::addEquality(), mlir::presburger::IntegerRelation::addInequality(), mlir::presburger::IntegerRelation::getNumCols(), getNumCommonLoops(), mlir::presburger::IntegerRelation::getNumDimVars(), and min().
Referenced by mlir::checkMemrefAccessDependence().
|
static |
Definition at line 391 of file AffineAnalysis.cpp.
References mlir::presburger::IntegerRelation::addEquality(), mlir::presburger::IntegerRelation::getConstantBound(), mlir::presburger::IntegerRelation::getNumCols(), getNumCommonLoops(), mlir::presburger::IntegerRelation::getNumDimVars(), mlir::presburger::IntegerRelation::getNumVars(), mlir::FlatAffineValueConstraints::insertDimVar(), mlir::presburger::IntegerRelation::LB, max(), min(), mlir::FlatAffineValueConstraints::projectOut(), and mlir::presburger::IntegerRelation::UB.
Referenced by mlir::checkMemrefAccessDependence().
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().
|
static |
Definition at line 281 of file AffineAnalysis.cpp.
References mlir::getForInductionVarOwner(), mlir::presburger::IntegerRelation::getNumDimVars(), mlir::FlatAffineValueConstraints::getValue(), mlir::isForInductionVar(), and min().
Referenced by addOrderingConstraints(), mlir::checkMemrefAccessDependence(), and computeDirectionVector().
|
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().
|
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.
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().
|
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().