MLIR  20.0.0git
Public Types | Public Attributes | List of all members
mlir::linalg::ControlDropUnitDims Struct Reference

Transformation to drop unit-extent dimensions from linalg.generic operations. More...

#include "mlir/Dialect/Linalg/Transforms/Transforms.h"

Public Types

enum class  RankReductionStrategy { ReassociativeReshape , ExtractInsertSlice }
 
using ControlFnTy = std::function< SmallVector< unsigned >(Operation *)>
 

Public Attributes

RankReductionStrategy rankReductionStrategy
 
ControlFnTy controlFn
 

Detailed Description

Transformation to drop unit-extent dimensions from linalg.generic operations.

Definition at line 473 of file Transforms.h.

Member Typedef Documentation

◆ ControlFnTy

Definition at line 479 of file Transforms.h.

Member Enumeration Documentation

◆ RankReductionStrategy

Enumerator
ReassociativeReshape 
ExtractInsertSlice 

Definition at line 474 of file Transforms.h.

Member Data Documentation

◆ controlFn

ControlFnTy mlir::linalg::ControlDropUnitDims::controlFn
Initial value:
= [](Operation *op) {
if (auto genericOp = dyn_cast_or_null<GenericOp>(op)) {
return llvm::to_vector(llvm::seq<unsigned>(0, genericOp.getNumLoops()));
}
if (auto padOp = dyn_cast_or_null<tensor::PadOp>(op)) {
return llvm::to_vector(
llvm::seq<unsigned>(0, padOp.getSourceType().getRank()));
}
return SmallVector<unsigned>{};
}

Definition at line 480 of file Transforms.h.

◆ rankReductionStrategy

RankReductionStrategy mlir::linalg::ControlDropUnitDims::rankReductionStrategy

The documentation for this struct was generated from the following file: