#include "IterationGraphSorter.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/SparseTensor/IR/SparseTensor.h"
#include "mlir/Dialect/SparseTensor/IR/SparseTensorType.h"
#include "mlir/Dialect/Utils/StructuredOpsUtils.h"
#include "mlir/IR/AffineExprVisitor.h"
#include "mlir/IR/BuiltinTypes.h"
usingnamespacemlir;
usingnamespacemlir::sparse_tensor;
namespace {
class AffineDimFinder : public AffineExprVisitor<AffineDimFinder> { … };
struct AffineDimCollector : public AffineExprVisitor<AffineDimCollector> { … };
}
inline static bool includesAny(SortMask mask1, SortMask mask2) { … }
inline static bool includesDenseInput(SortMask mask) { … }
inline static bool includesDenseOutput(SortMask mask) { … }
AffineMap IterationGraphSorter::topoSort() { … }
IterationGraphSorter
IterationGraphSorter::fromGenericOp(linalg::GenericOp genericOp) { … }
IterationGraphSorter::IterationGraphSorter(
SmallVector<Value> &&ins, SmallVector<AffineMap> &&loop2InsLvl, Value out,
AffineMap loop2OutLvl, SmallVector<utils::IteratorType> &&iterTypes)
: … { … }
AffineMap IterationGraphSorter::sort(SortMask mask, Value ignored) { … }
void IterationGraphSorter::addConstraints(Value t, AffineMap loop2LvlMap) { … }