MLIR
20.0.0git
|
#include "mlir/Dialect/Affine/Analysis/AffineAnalysis.h"
#include "mlir/Analysis/Presburger/IntegerRelation.h"
#include "mlir/Analysis/Presburger/PresburgerSpace.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/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 <optional>
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 * | getCommonBlockInAffineScope (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, IntegerRelation *dependenceDomain) |
static void | computeDirectionVector (const FlatAffineValueConstraints &srcDomain, const FlatAffineValueConstraints &dstDomain, unsigned loopDepth, IntegerPolyhedron *dependenceDomain, SmallVector< DependenceComponent, 2 > *dependenceComponents) |
#define DEBUG_TYPE "affine-analysis" |
Definition at line 32 of file AffineAnalysis.cpp.
|
static |
Definition at line 384 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::affine::checkMemrefAccessDependence().
|
static |
Definition at line 410 of file AffineAnalysis.cpp.
References mlir::presburger::IntegerRelation::addEquality(), mlir::presburger::IntegerRelation::getConstantBound64(), mlir::presburger::IntegerRelation::getNumCols(), getNumCommonLoops(), mlir::presburger::IntegerRelation::getNumDimVars(), mlir::presburger::IntegerRelation::getNumVars(), mlir::presburger::IntegerPolyhedron::insertVar(), max(), min(), and mlir::presburger::IntegerRelation::projectOut().
Referenced by mlir::affine::checkMemrefAccessDependence().
Returns the closest surrounding block common to opA
and opB
.
opA
and opB
should be in the same affine scope. Returns nullptr if such a block does not exist (when the two ops are in different blocks of an op starting an AffineScope
).
Definition at line 322 of file AffineAnalysis.cpp.
References mlir::Operation::getBlock(), mlir::Block::getParentOp(), mlir::Operation::hasTrait(), and mlir::Block::push_back().
Referenced by mlir::affine::checkMemrefAccessDependence(), and srcAppearsBeforeDstInAncestralBlock().
|
static |
Definition at line 295 of file AffineAnalysis.cpp.
References mlir::affine::getForInductionVarOwner(), mlir::presburger::IntegerRelation::getNumDimVars(), mlir::FlatLinearValueConstraints::getValue(), mlir::affine::isAffineForInductionVar(), mlir::affine::isAffineParallelInductionVar(), and min().
Referenced by addOrderingConstraints(), mlir::affine::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 285 of file AffineAnalysis.cpp.
References mlir::affine::getEnclosingAffineOps(), and mlir::affine::getIndexSet().
Referenced by mlir::affine::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 43 of file AffineAnalysis.cpp.
References mlir::matchReduction().
Referenced by mlir::affine::getSupportedReductions().
Returns true if v
is allocated locally to enclosingOp
– i.e., it is allocated by an operation nested within enclosingOp
.
Definition at line 125 of file AffineAnalysis.cpp.
References mlir::Value::getDefiningOp(), and mlir::Operation::isProperAncestor().
Referenced by mlir::affine::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 and have a common surrounding block within it.
Definition at line 358 of file AffineAnalysis.cpp.
References mlir::Block::findAncestorOpInBlock(), getCommonBlockInAffineScope(), mlir::Operation::isBeforeInBlock(), and mlir::affine::MemRefAccess::opInst.
Referenced by mlir::affine::checkMemrefAccessDependence().