MLIR 24.0.0git
VectorLinearize.cpp File Reference
#include "mlir/Dialect/UB/IR/UBOps.h"
#include "mlir/Dialect/Vector/IR/VectorOps.h"
#include "mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h"
#include "mlir/IR/Attributes.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/Operation.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/TypeUtilities.h"
#include "mlir/Transforms/DialectConversion.h"
#include "llvm/ADT/ArrayRef.h"
#include <cstdint>
#include <limits>
#include <numeric>
#include <optional>

Go to the source code of this file.

Functions

static FailureOr< Attribute > linearizeConstAttr (Location loc, ConversionPatternRewriter &rewriter, VectorType resType, Attribute value)
static bool isLinearizable (Operation *op)
 This method defines the set of operations that are linearizable, and hence that are considered illegal for the conversion target.
static SmallVector< std::pair< Type, unsigned > > getTypeBitWidthBoundPairs (Operation *op, unsigned targetBitWidth)
 Get the set of operand/result types to check for sufficiently small inner-most dimension size.
static bool hasWideInnerDim (Operation *op, unsigned targetBitWidth)
 Returns true if any checked vector type of op's inner-most dimension size is equal to or exceeds target bit width.

Function Documentation

◆ getTypeBitWidthBoundPairs()

SmallVector< std::pair< Type, unsigned > > getTypeBitWidthBoundPairs ( Operation * op,
unsigned targetBitWidth )
static

Get the set of operand/result types to check for sufficiently small inner-most dimension size.

Definition at line 1014 of file VectorLinearize.cpp.

References mlir::Operation::getResultTypes().

Referenced by hasWideInnerDim().

◆ hasWideInnerDim()

bool hasWideInnerDim ( Operation * op,
unsigned targetBitWidth )
static

Returns true if any checked vector type of op's inner-most dimension size is equal to or exceeds target bit width.

Definition at line 1034 of file VectorLinearize.cpp.

References getTypeBitWidthBoundPairs().

◆ isLinearizable()

bool isLinearizable ( Operation * op)
static

This method defines the set of operations that are linearizable, and hence that are considered illegal for the conversion target.

Definition at line 931 of file VectorLinearize.cpp.

References mlir::Operation::getDialect(), mlir::Dialect::getNamespace(), and mlir::Operation::hasTrait().

◆ linearizeConstAttr()

FailureOr< Attribute > linearizeConstAttr ( Location loc,
ConversionPatternRewriter & rewriter,
VectorType resType,
Attribute value )
static

Definition at line 32 of file VectorLinearize.cpp.