|
MLIR-AIE
|
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 ConvMacChainGroupList & | getGroupsInChain () |
| 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< ConvMac > | getConvMacFromMulOp (arith::MulIOp mulOp) |
| std::unique_ptr< ConvMac > | getConvMacFromAddOp (arith::AddIOp addOp) |
| LongestConvMACChainAnalysis (arith::AddIOp addOp) | |
Public Attributes | |
| std::unique_ptr< ConvMacChain > | convMacChain |
| ConvMacChainGroupList | groupsInChain |
Static Public Attributes | |
| static AnalysisManager * | am = nullptr |
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.
| typedef SmallVector<std::unique_ptr<ConvMac>, 8> LongestConvMACChainAnalysis::ConvMacChain |
Definition at line 80 of file FoldMulAddChainToConvOp.cpp.
| typedef SmallVector<ConvMacChainGroup, 8> LongestConvMACChainAnalysis::ConvMacChainGroupList |
Definition at line 81 of file FoldMulAddChainToConvOp.cpp.
|
inline |
Definition at line 368 of file FoldMulAddChainToConvOp.cpp.
|
inline |
Definition at line 216 of file FoldMulAddChainToConvOp.cpp.
Referenced by xilinx::aievec::configureAIEVecConvOpTransformationLegalizations().
|
inline |
Definition at line 317 of file FoldMulAddChainToConvOp.cpp.
|
inline |
Definition at line 227 of file FoldMulAddChainToConvOp.cpp.
References xilinx::aievec::getElementSizeInBits().
|
inline |
Definition at line 199 of file FoldMulAddChainToConvOp.cpp.
|
inline |
Definition at line 191 of file FoldMulAddChainToConvOp.cpp.
|
inline |
Definition at line 176 of file FoldMulAddChainToConvOp.cpp.
|
inline |
Definition at line 141 of file FoldMulAddChainToConvOp.cpp.
|
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().
|
static |
Definition at line 46 of file FoldMulAddChainToConvOp.cpp.
Referenced by xilinx::aievec::configureAIEVecConvOpTransformationLegalizations(), and xilinx::aievec::AIEVecConvAnalysis::runOnOperation().
| std::unique_ptr<ConvMacChain> LongestConvMACChainAnalysis::convMacChain |
Definition at line 83 of file FoldMulAddChainToConvOp.cpp.
Referenced by FoldMulAddChainToConvOpPattern::matchAndRewrite(), and sortChain().
| ConvMacChainGroupList LongestConvMACChainAnalysis::groupsInChain |
Definition at line 84 of file FoldMulAddChainToConvOp.cpp.