MLIR  20.0.0git
Functions
AffineMap.cpp File Reference
#include "mlir/IR/AffineMap.h"
#include "AffineMapDetail.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/BuiltinTypes.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <iterator>
#include <numeric>
#include <optional>
#include <type_traits>

Go to the source code of this file.

Functions

template<typename AffineExprContainer >
static SmallVector< AffineMap, 4 > inferFromExprList (ArrayRef< AffineExprContainer > exprsList, MLIRContext *context)
 Creates an affine map each for each list of AffineExpr's in exprsList while inferring the right number of dimensional and symbolic inputs needed based on the maximum dimensional and symbolic identifier appearing in the expressions. More...
 
static SmallVector< AffineMapcompressUnusedListImpl (ArrayRef< AffineMap > maps, llvm::function_ref< AffineMap(AffineMap)> compressionFun)
 Implementation detail to compress multiple affine maps with a compressionFun that is expected to be either compressUnusedDims or compressUnusedSymbols. More...
 
template<typename AffineDimOrSymExpr >
static AffineMap projectCommonImpl (AffineMap map, const llvm::SmallBitVector &toProject, bool compress)
 Common implementation to project out dimensions or symbols from an affine map based on the template type. More...
 

Function Documentation

◆ compressUnusedListImpl()

static SmallVector<AffineMap> compressUnusedListImpl ( ArrayRef< AffineMap maps,
llvm::function_ref< AffineMap(AffineMap)>  compressionFun 
)
static

Implementation detail to compress multiple affine maps with a compressionFun that is expected to be either compressUnusedDims or compressUnusedSymbols.

The implementation keeps track of num dims and symbols across the different affine maps.

Definition at line 687 of file AffineMap.cpp.

Referenced by mlir::compressUnusedDims(), and mlir::compressUnusedSymbols().

◆ inferFromExprList()

template<typename AffineExprContainer >
static SmallVector<AffineMap, 4> inferFromExprList ( ArrayRef< AffineExprContainer >  exprsList,
MLIRContext context 
)
static

Creates an affine map each for each list of AffineExpr's in exprsList while inferring the right number of dimensional and symbolic inputs needed based on the maximum dimensional and symbolic identifier appearing in the expressions.

Definition at line 297 of file AffineMap.cpp.

References mlir::AffineMap::get(), and mlir::getMaxDimAndSymbol().

Referenced by mlir::AffineMap::inferFromExprList().

◆ projectCommonImpl()

template<typename AffineDimOrSymExpr >
static AffineMap projectCommonImpl ( AffineMap  map,
const llvm::SmallBitVector &  toProject,
bool  compress 
)
static

Common implementation to project out dimensions or symbols from an affine map based on the template type.

Additionally, if 'compress' is true, the projected out dimensions or symbols are also dropped from the resulting map.

Definition at line 860 of file AffineMap.cpp.

References mlir::AffineMap::get(), mlir::getAffineConstantExpr(), mlir::getAffineDimExpr(), mlir::getAffineSymbolExpr(), mlir::AffineMap::getContext(), mlir::AffineMap::getNumDims(), mlir::AffineMap::getNumResults(), mlir::AffineMap::getNumSymbols(), mlir::AffineMap::getResults(), mlir::AffineExpr::replaceDims(), and mlir::AffineExpr::replaceSymbols().