MLIR-AIE
Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
LongestConvMACChainAnalysis Struct Reference

This analysis builds the longest possible chain of MAC operations whose operands are a vector that may or may not be shifted, and a broadcast. More...

+ Collaboration diagram for LongestConvMACChainAnalysis:

Classes

struct  ConvMac
 
struct  ConvMacChainGroup
 

Public Types

typedef SmallVector< std::unique_ptr< ConvMac >, 8 > ConvMacChain
 
typedef SmallVector< ConvMacChainGroup, 8 > ConvMacChainGroupList
 

Public Member Functions

void sortChain ()
 Sort the chain of MACs by sources.
 
const ConvMacChainGroupListgetGroupsInChain ()
 
int64_t getGroupSignalShift (uint64_t fromIdx, uint64_t toIdx)
 
int64_t getGroupBcastShift (uint64_t fromIdx, uint64_t toIdx)
 
int64_t getGroupBcastDist (uint64_t fromIdx, uint64_t toIdx)
 
bool canChainBeReplacedWithConvOps ()
 
std::unique_ptr< ConvMacgetConvMacFromMulOp (arith::MulIOp mulOp)
 
std::unique_ptr< ConvMacgetConvMacFromAddOp (arith::AddIOp addOp)
 
 LongestConvMACChainAnalysis (arith::AddIOp addOp)
 

Public Attributes

std::unique_ptr< ConvMacChainconvMacChain
 
ConvMacChainGroupList groupsInChain
 

Static Public Attributes

static AnalysisManager * am = nullptr
 

Detailed Description

This analysis builds the longest possible chain of MAC operations whose operands are a vector that may or may not be shifted, and a broadcast.

That is, these MACs represent vector x scalar ops, and are candidates to be grouped and replaced by mul_conv/fma_conv ops in AIE2.

Definition at line 45 of file FoldMulAddChainToConvOp.cpp.

Member Typedef Documentation

◆ ConvMacChain

typedef SmallVector<std::unique_ptr<ConvMac>, 8> LongestConvMACChainAnalysis::ConvMacChain

Definition at line 80 of file FoldMulAddChainToConvOp.cpp.

◆ ConvMacChainGroupList

Definition at line 81 of file FoldMulAddChainToConvOp.cpp.

Constructor & Destructor Documentation

◆ LongestConvMACChainAnalysis()

LongestConvMACChainAnalysis::LongestConvMACChainAnalysis ( arith::AddIOp  addOp)
inline

Definition at line 368 of file FoldMulAddChainToConvOp.cpp.

Member Function Documentation

◆ canChainBeReplacedWithConvOps()

bool LongestConvMACChainAnalysis::canChainBeReplacedWithConvOps ( )
inline

◆ getConvMacFromAddOp()

std::unique_ptr< ConvMac > LongestConvMACChainAnalysis::getConvMacFromAddOp ( arith::AddIOp  addOp)
inline

Definition at line 317 of file FoldMulAddChainToConvOp.cpp.

◆ getConvMacFromMulOp()

std::unique_ptr< ConvMac > LongestConvMACChainAnalysis::getConvMacFromMulOp ( arith::MulIOp  mulOp)
inline

◆ getGroupBcastDist()

int64_t LongestConvMACChainAnalysis::getGroupBcastDist ( uint64_t  fromIdx,
uint64_t  toIdx 
)
inline

Definition at line 199 of file FoldMulAddChainToConvOp.cpp.

◆ getGroupBcastShift()

int64_t LongestConvMACChainAnalysis::getGroupBcastShift ( uint64_t  fromIdx,
uint64_t  toIdx 
)
inline

Definition at line 191 of file FoldMulAddChainToConvOp.cpp.

◆ getGroupSignalShift()

int64_t LongestConvMACChainAnalysis::getGroupSignalShift ( uint64_t  fromIdx,
uint64_t  toIdx 
)
inline

Definition at line 176 of file FoldMulAddChainToConvOp.cpp.

◆ getGroupsInChain()

const ConvMacChainGroupList & LongestConvMACChainAnalysis::getGroupsInChain ( )
inline

Definition at line 141 of file FoldMulAddChainToConvOp.cpp.

◆ sortChain()

void LongestConvMACChainAnalysis::sortChain ( )
inline

Sort the chain of MACs by sources.

When two MACs share the same sources, sort them by the broadcast index. If they don't, sort them by the order of the ops in the code. This function should be called after the chain is completed, and before operating on the groups of MACs. After sorting, MACs that can be fused into single convolution ops will be contiguous in the chain.

Definition at line 92 of file FoldMulAddChainToConvOp.cpp.

References convMacChain.

Referenced by xilinx::aievec::AIEVecConvAnalysis::runOnOperation().

Member Data Documentation

◆ am

AnalysisManager * LongestConvMACChainAnalysis::am = nullptr
static

◆ convMacChain

std::unique_ptr<ConvMacChain> LongestConvMACChainAnalysis::convMacChain

◆ groupsInChain

ConvMacChainGroupList LongestConvMACChainAnalysis::groupsInChain

Definition at line 84 of file FoldMulAddChainToConvOp.cpp.


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