MLIR 22.0.0git
IndexingUtils.cpp File Reference
#include "mlir/Dialect/Utils/IndexingUtils.h"
#include "mlir/Dialect/Utils/StaticValueUtils.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/MLIRContext.h"
#include "llvm/ADT/STLExtras.h"
#include <numeric>
#include <optional>

Go to the source code of this file.

Functions

template<typename ExprType>
SmallVector< ExprType > computeSuffixProductImpl (ArrayRef< ExprType > sizes, ExprType unit)
template<typename ExprType>
SmallVector< ExprType > computeElementwiseMulImpl (ArrayRef< ExprType > v1, ArrayRef< ExprType > v2)
template<typename ExprType>
ExprType linearizeImpl (ArrayRef< ExprType > offsets, ArrayRef< ExprType > basis, ExprType zero)
template<typename ExprType, typename DivOpTy>
SmallVector< ExprType > delinearizeImpl (ExprType linearIndex, ArrayRef< ExprType > strides, DivOpTy divOp)
static MLIRContextgetContext (OpFoldResult val)
static SmallVector< int64_tpadTileShapeToSize (ArrayRef< int64_t > tileShape, unsigned paddedSize)
 Apply left-padding by 1 to the tile shape if required.

Function Documentation

◆ computeElementwiseMulImpl()

template<typename ExprType>
SmallVector< ExprType > computeElementwiseMulImpl ( ArrayRef< ExprType > v1,
ArrayRef< ExprType > v2 )

Definition at line 33 of file IndexingUtils.cpp.

References result.

Referenced by mlir::computeElementwiseMul(), and mlir::computeElementwiseMul().

◆ computeSuffixProductImpl()

template<typename ExprType>
SmallVector< ExprType > computeSuffixProductImpl ( ArrayRef< ExprType > sizes,
ExprType unit )

Definition at line 22 of file IndexingUtils.cpp.

◆ delinearizeImpl()

template<typename ExprType, typename DivOpTy>
SmallVector< ExprType > delinearizeImpl ( ExprType linearIndex,
ArrayRef< ExprType > strides,
DivOpTy divOp )

Definition at line 55 of file IndexingUtils.cpp.

Referenced by mlir::delinearize(), and mlir::delinearize().

◆ getContext()

MLIRContext * getContext ( OpFoldResult val)
static

Definition at line 277 of file IndexingUtils.cpp.

◆ linearizeImpl()

template<typename ExprType>
ExprType linearizeImpl ( ArrayRef< ExprType > offsets,
ArrayRef< ExprType > basis,
ExprType zero )

Definition at line 45 of file IndexingUtils.cpp.

Referenced by mlir::linearize(), and mlir::linearize().

◆ padTileShapeToSize()

SmallVector< int64_t > padTileShapeToSize ( ArrayRef< int64_t > tileShape,
unsigned paddedSize )
static

Apply left-padding by 1 to the tile shape if required.

Definition at line 329 of file IndexingUtils.cpp.

References result.

Referenced by mlir::detail::TileOffsetRangeImpl::TileOffsetRangeImpl().