MLIR 24.0.0git
VectorDropLeadUnitDim.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "vector-drop-unit-dim"

Functions

static VectorType trimLeadingUnitDims (VectorType oldType, bool trimOnlyOneDim=false, bool allowRank0=false)
static SmallVector< int64_t > splatZero (int64_t rank)
 Return a smallVector of size rank containing all zeros.
static Operation * createWithProperties (OpBuilder &builder, Operation *op, ValueRange operands, TypeRange resultTypes)
static Value dropLeadingUnitDimViaShapeCastOrExtract (RewriterBase &rewriter, Location loc, mlir::Value oldVal)
static Value restoreLeadingUnitDimViaShapeCastOrBcast (RewriterBase &rewriter, Location loc, mlir::Value oldVal, mlir::Type newTy)
static Value dropLeadingOneDimsFromOperand (OpBuilder &b, Location loc, Value operand, int64_t nDropped)

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "vector-drop-unit-dim"

Definition at line 20 of file VectorDropLeadUnitDim.cpp.

Function Documentation

◆ createWithProperties()

◆ dropLeadingOneDimsFromOperand()

Value dropLeadingOneDimsFromOperand ( OpBuilder & b,
Location loc,
Value operand,
int64_t nDropped )
static

Definition at line 592 of file VectorDropLeadUnitDim.cpp.

References b, mlir::Value::getType(), and splatZero().

◆ dropLeadingUnitDimViaShapeCastOrExtract()

Value dropLeadingUnitDimViaShapeCastOrExtract ( RewriterBase & rewriter,
Location loc,
mlir::Value oldVal )
static

◆ restoreLeadingUnitDimViaShapeCastOrBcast()

Value restoreLeadingUnitDimViaShapeCastOrBcast ( RewriterBase & rewriter,
Location loc,
mlir::Value oldVal,
mlir::Type newTy )
static

◆ splatZero()

SmallVector< int64_t > splatZero ( int64_t rank)
static

Return a smallVector of size rank containing all zeros.

Definition at line 54 of file VectorDropLeadUnitDim.cpp.

Referenced by dropLeadingOneDimsFromOperand().

◆ trimLeadingUnitDims()

VectorType trimLeadingUnitDims ( VectorType oldType,
bool trimOnlyOneDim = false,
bool allowRank0 = false )
static

Definition at line 27 of file VectorDropLeadUnitDim.cpp.

Referenced by dropLeadingUnitDimViaShapeCastOrExtract().