MLIR
21.0.0git
|
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...
#include "mlir/Dialect/Affine/Analysis/Utils.h"
Public Member Functions | |
LogicalResult | getAsConstraints (FlatAffineValueConstraints *cst) const |
LogicalResult | getSourceAsConstraints (FlatAffineValueConstraints &cst) const |
Adds to 'cst' constraints which represent the original loop bounds on 'ivs' in 'this'. More... | |
void | clearBounds () |
bool | isEmpty () const |
Returns true if the computation slice is empty. More... | |
std::optional< bool > | isMaximal () const |
Returns true if the computation slice encloses all the iterations of the sliced loop nest. More... | |
std::optional< bool > | isSliceValid () const |
Checks the validity of the slice computed. More... | |
void | dump () const |
Public Attributes | |
SmallVector< Value, 4 > | ivs |
SmallVector< AffineMap, 4 > | lbs |
SmallVector< AffineMap, 4 > | ubs |
std::vector< SmallVector< Value, 4 > > | lbOperands |
std::vector< SmallVector< Value, 4 > > | ubOperands |
Block::iterator | insertPoint |
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).
Loop bound AffineMaps which are non-null represent slices of that loop's iteration space.
void ComputationSliceState::clearBounds | ( | ) |
Definition at line 846 of file Utils.cpp.
Referenced by mlir::affine::computeSliceUnion().
void ComputationSliceState::dump | ( | ) | const |
Definition at line 853 of file Utils.cpp.
References mlir::detail::enumerate().
LogicalResult ComputationSliceState::getAsConstraints | ( | FlatAffineValueConstraints * | cst | ) | const |
Definition at line 810 of file Utils.cpp.
References mlir::affine::FlatAffineValueConstraints::addAffineForOpDomain(), mlir::affine::FlatAffineValueConstraints::addBound(), mlir::affine::FlatAffineValueConstraints::addSliceBounds(), mlir::FlatLinearValueConstraints::containsVar(), mlir::getConstantIntValue(), mlir::affine::getForInductionVarOwner(), and mlir::affine::isValidSymbol().
Referenced by mlir::affine::computeSliceUnion().
LogicalResult ComputationSliceState::getSourceAsConstraints | ( | FlatAffineValueConstraints & | cst | ) | const |
Adds to 'cst' constraints which represent the original loop bounds on 'ivs' in 'this'.
This corresponds to the original domain of the loop nest from which the slice is being computed. Returns failure if we cannot add loop bounds because of unsupported cases.
Definition at line 794 of file Utils.cpp.
References mlir::affine::FlatAffineValueConstraints::addAffineForOpDomain(), and mlir::affine::getForInductionVarOwner().
|
inline |
Returns true if the computation slice is empty.
Definition at line 342 of file Utils.h.
References ivs.
Referenced by isFusionProfitable().
std::optional< bool > ComputationSliceState::isMaximal | ( | ) | const |
Returns true if the computation slice encloses all the iterations of the sliced loop nest.
Returns false if it does not. Returns std::nullopt if it cannot determine if the slice is maximal or not.
Definition at line 1018 of file Utils.cpp.
References mlir::affine::FlatAffineValueConstraints::addAffineForOpDomain(), mlir::affine::FlatAffineValueConstraints::addDomainFromSliceMaps(), mlir::affine::getForInductionVarOwner(), mlir::presburger::IntegerRelation::getNumDimVars(), mlir::presburger::PresburgerRelation::isIntegerEmpty(), and mlir::presburger::PresburgerSet::subtract().
Referenced by canRemoveSrcNodeAfterFusion(), and mlir::affine::getComputationSliceState().
std::optional< bool > ComputationSliceState::isSliceValid | ( | ) | const |
Checks the validity of the slice computed.
Returns true if it is deterministically verified that the original iteration space of the slice is contained within the new iteration space that is created after fusing 'this' slice into its destination.
This is done using the following steps:
Definition at line 948 of file Utils.cpp.
References mlir::presburger::IntegerRelation::dump(), mlir::presburger::IntegerRelation::getNumLocalVars(), mlir::presburger::IntegerRelation::getNumSymbolVars(), mlir::presburger::IntegerRelation::getNumVars(), mlir::presburger::PresburgerRelation::isIntegerEmpty(), mlir::FlatLinearValueConstraints::projectOut(), and mlir::presburger::PresburgerSet::subtract().
Referenced by mlir::affine::computeSliceUnion().
Block::iterator mlir::affine::ComputationSliceState::insertPoint |
Definition at line 323 of file Utils.h.
Referenced by mlir::affine::computeSliceUnion(), mlir::affine::fuseLoops(), mlir::affine::getComputationSliceState(), and mlir::affine::getFusionComputeCost().
SmallVector<Value, 4> mlir::affine::ComputationSliceState::ivs |
Definition at line 313 of file Utils.h.
Referenced by mlir::affine::buildSliceTripCountMap(), mlir::affine::MemRefRegion::compute(), mlir::affine::computeSliceUnion(), mlir::affine::fuseLoops(), mlir::affine::getComputationSliceState(), and isEmpty().
std::vector<SmallVector<Value, 4> > mlir::affine::ComputationSliceState::lbOperands |
Definition at line 319 of file Utils.h.
Referenced by mlir::affine::MemRefRegion::compute(), mlir::affine::computeSliceUnion(), mlir::affine::fuseLoops(), mlir::affine::getComputationSliceState(), and mlir::affine::insertBackwardComputationSlice().
SmallVector<AffineMap, 4> mlir::affine::ComputationSliceState::lbs |
Definition at line 315 of file Utils.h.
Referenced by mlir::affine::buildSliceTripCountMap(), mlir::affine::MemRefRegion::compute(), mlir::affine::computeSliceUnion(), mlir::affine::fuseLoops(), mlir::affine::getComputationSliceState(), and mlir::affine::insertBackwardComputationSlice().
std::vector<SmallVector<Value, 4> > mlir::affine::ComputationSliceState::ubOperands |
Definition at line 321 of file Utils.h.
Referenced by mlir::affine::computeSliceUnion(), mlir::affine::fuseLoops(), mlir::affine::getComputationSliceState(), and mlir::affine::insertBackwardComputationSlice().
SmallVector<AffineMap, 4> mlir::affine::ComputationSliceState::ubs |
Definition at line 317 of file Utils.h.
Referenced by mlir::affine::buildSliceTripCountMap(), mlir::affine::MemRefRegion::compute(), mlir::affine::computeSliceUnion(), mlir::affine::fuseLoops(), mlir::affine::getComputationSliceState(), and mlir::affine::insertBackwardComputationSlice().