MLIR 24.0.0git
IterationGraphSorter.cpp File Reference

Go to the source code of this file.

Functions

static bool includesAny (SortMask mask1, SortMask mask2)
static bool includesDenseInput (SortMask mask)
static bool includesDenseOutput (SortMask mask)
static unsigned getLoopSparsityRank (unsigned loop, ArrayRef< Value > allTensors, ArrayRef< AffineMap > allMaps, bool preferDenseOuter)
 Returns a sparsity rank for loop ordering: lower values indicate dimensions that should be placed in outer loops.
static SmallVector< unsigned > getLoopUseCounts (linalg::GenericOp genericOp)
 Count distinct input accesses whose indexing expressions use each loop.

Function Documentation

◆ getLoopSparsityRank()

unsigned getLoopSparsityRank ( unsigned loop,
ArrayRef< Value > allTensors,
ArrayRef< AffineMap > allMaps,
bool preferDenseOuter )
static

Returns a sparsity rank for loop ordering: lower values indicate dimensions that should be placed in outer loops.

When preferDenseOuter is true the ranking is 0 = Dense, 1 = Compressed, 2 = Singleton, 3 = Other/Unknown. Otherwise 0 = Singleton, 1 = Compressed, 2 = Dense, 3 = Other/Unknown.

Definition at line 90 of file IterationGraphSorter.cpp.

References mlir::sparse_tensor::getSparseTensorEncoding(), mlir::sparse_tensor::isCompressedLT(), mlir::sparse_tensor::isDenseLT(), and mlir::sparse_tensor::isSingletonLT().

◆ getLoopUseCounts()

SmallVector< unsigned > getLoopUseCounts ( linalg::GenericOp genericOp)
static

Count distinct input accesses whose indexing expressions use each loop.

Definition at line 140 of file IterationGraphSorter.cpp.

References mlir::AffineMap::getResults().

◆ includesAny()

bool includesAny ( SortMask mask1,
SortMask mask2 )
inlinestatic

Definition at line 72 of file IterationGraphSorter.cpp.

Referenced by includesDenseInput(), and includesDenseOutput().

◆ includesDenseInput()

bool includesDenseInput ( SortMask mask)
inlinestatic

◆ includesDenseOutput()

bool includesDenseOutput ( SortMask mask)
inlinestatic