MLIR-AIE
|
Namespaces | |
namespace | aie1 |
Functions | |
void | populateAIEVecToLLVMConversionPatterns (mlir::LLVMTypeConverter &converter, mlir::RewritePatternSet &patterns) |
std::unique_ptr< mlir::OperationPass< mlir::ModuleOp > > | createConvertAIEVecToLLVMPass () |
char | getHexValue (int val) |
bool | isPowerOfTwo (int32_t n) |
mlir::VectorType | createVectorType (unsigned lanes, mlir::Type elementType) |
int32_t | getElementSizeInBits (mlir::VectorType type) |
unsigned | getVectorLaneSize (mlir::VectorType type) |
int32_t | getVectorSizeInBits (mlir::VectorType type) |
bool | isAIEOp (mlir::Operation *op) |
mlir::VectorType | getVectorOpDestType (mlir::VectorType type, bool AIE2) |
mlir::AffineExpr | flattenedStridedExpr (llvm::ArrayRef< int64_t > sizes, llvm::ArrayRef< mlir::AffineExpr > exprs, mlir::MLIRContext *context) |
mlir::AffineExpr | constructLinearizedAffineExprForUPDOp (UPDOp updOp) |
std::pair< mlir::AffineExpr, int32_t > | extractBaseAndOffset (mlir::AffineExpr expr) |
bool | isAssumingNoImplicitBroadcastOfDynamicSizes (mlir::Block *block) |
bool | isAssumingNoImplicitBroadcastOfDynamicSizes (mlir::OpBuilder &builder) |
std::unique_ptr< mlir::Pass > | createAIEVecConvolutionAnalysisPass () |
void | registerAIEVecToCppTranslation () |
void | buildConvertVectorToAIEVec (mlir::OpPassManager &pm, const ConvertVectorToAIEVecOptions &options) |
Adds the "convert-vector-to-aievec" pipeline to the OpPassManager . | |
void | buildCanonicalizeVectorForAIEVec (mlir::OpPassManager &pm, const CanonicalizeVectorForAIEVecOptions &options) |
void | buildLowerVectorToAIEVec (mlir::OpPassManager &pm, const LowerVectorToAIEVecOptions &options) |
void | buildOptimizeAIEVec (mlir::OpPassManager &pm, const OptimizeAIEVecOptions &options) |
void | registerAIEVecPipelines () |
Register all pipelines for the AIE Vector dialect. | |
std::unique_ptr<::mlir::Pass > | createCopyRemovalPass () |
Create a pass that removes unnecessary Copy operations. | |
std::unique_ptr<::mlir::Pass > | createDynamicSizeNoImplicitBroadcastPass () |
void | buildDynamicSizeNoImplicitBroadcastPass (mlir::OpPassManager &pm) |
void | registerTransformDialectExtension (mlir::DialectRegistry ®istry) |
std::unique_ptr< mlir::Pass > | createAIEVectorizePass () |
template<typename TransferReadLikeOp , typename = std::enable_if_t< std::is_same_v<TransferReadLikeOp, mlir::vector::TransferReadOp> || std::is_same_v<TransferReadLikeOp, mlir::vector::TransferReadOp::Adaptor>>> | |
std::optional< int64_t > | getTransferReadAlignmentOffset (TransferReadLikeOp readOp, mlir::VectorType vType, int64_t alignment) |
mlir::VectorType | getFlattenedVectorType (mlir::VectorType vecTy) |
mlir::LogicalResult | translateAIEVecToCpp (mlir::Operation *op, bool aie2, mlir::raw_ostream &os) |
Translates the AIE vector dialect MLIR to C++ code. | |
std::string | getVectorTypeString (VectorType type, bool abbrev=false, bool acc=false) |
std::string | getMulOrFMAIntrinsicName (Operation *op) |
uint32_t | encodeSquare (uint32_t square) |
void | encodeConf (uint32_t conf[2], const BufferParams &x, const BufferParams &z, bool sub) |
void | populateAIEVecToLLVMConversionPatterns (mlir::LLVMTypeConverter &converter, mlir::RewritePatternSet &patterns, Aie2Fp32Emulation aie2Fp32EmulationOption) |
SmallVector< NamedAttribute > | buildFMAOpSplatAttrForElemTy (aievec::aie1::FMAOp fmaOp, int64_t bcastPos, int64_t step=1) |
void | configureAIEVecConvOpTransformationLegalizations (ConversionTarget &target, AnalysisManager &am, TargetBackend backend) |
void | populateAIEVecConvOpTransformationPatterns (RewritePatternSet &patterns, AnalysisManager &am, unsigned shiftParam, TargetBackend backend) |
void | configureAIEVecConvOpTransformationLegalizations (mlir::ConversionTarget &target, mlir::AnalysisManager &am, TargetBackend backend) |
void | populateAIEVecConvOpTransformationPatterns (mlir::RewritePatternSet &patterns, mlir::AnalysisManager &am, unsigned shiftParam, TargetBackend backend) |
template<typename TransferReadLikeOp , typename > | |
std::optional< int64_t > | getTransferReadAlignmentOffset (TransferReadLikeOp readOp, VectorType vType, int64_t alignment) |
template std::optional< int64_t > | getTransferReadAlignmentOffset (vector::TransferReadOp readOp, VectorType vType, int64_t alignment) |
template std::optional< int64_t > | getTransferReadAlignmentOffset (vector::TransferReadOp::Adaptor readOp, VectorType vType, int64_t alignment) |
VectorType | getFlattenedVectorType (VectorType vecTy) |
void xilinx::aievec::buildCanonicalizeVectorForAIEVec | ( | mlir::OpPassManager & | pm, |
const CanonicalizeVectorForAIEVecOptions & | options | ||
) |
Referenced by registerAIEVecPipelines().
void xilinx::aievec::buildConvertVectorToAIEVec | ( | mlir::OpPassManager & | pm, |
const ConvertVectorToAIEVecOptions & | options | ||
) |
Adds the "convert-vector-to-aievec" pipeline to the OpPassManager
.
This pipeline takes Vector
code, transforms it to make it compatible with the selected AIE
target, lowers it to AIEVec
dialect, and performs some optimizations based on the target AIE architecture.
Referenced by registerAIEVecPipelines().
void xilinx::aievec::buildDynamicSizeNoImplicitBroadcastPass | ( | mlir::OpPassManager & | pm | ) |
Referenced by registerAIEVecPipelines().
SmallVector< NamedAttribute > xilinx::aievec::buildFMAOpSplatAttrForElemTy | ( | aievec::aie1::FMAOp | fmaOp, |
int64_t | bcastPos, | ||
int64_t | step = 1 |
||
) |
Definition at line 279 of file VectorToAIEVecConversions.cpp.
Referenced by MergeSingleColumnI16FMAOpPattern::matchAndRewrite(), and FoldSplatToFMAOp::matchAndRewrite().
void xilinx::aievec::buildLowerVectorToAIEVec | ( | mlir::OpPassManager & | pm, |
const LowerVectorToAIEVecOptions & | options | ||
) |
Referenced by registerAIEVecPipelines().
void xilinx::aievec::buildOptimizeAIEVec | ( | mlir::OpPassManager & | pm, |
const OptimizeAIEVecOptions & | options | ||
) |
Referenced by registerAIEVecPipelines().
void xilinx::aievec::configureAIEVecConvOpTransformationLegalizations | ( | ConversionTarget & | target, |
AnalysisManager & | am, | ||
TargetBackend | backend | ||
) |
Definition at line 517 of file FoldMulAddChainToConvOp.cpp.
References LongestConvMACChainAnalysis::am, and LongestConvMACChainAnalysis::canChainBeReplacedWithConvOps().
Referenced by AIEVecConvOpTransformationPass::runOnOperation().
void xilinx::aievec::configureAIEVecConvOpTransformationLegalizations | ( | mlir::ConversionTarget & | target, |
mlir::AnalysisManager & | am, | ||
TargetBackend | backend | ||
) |
|
inline |
Definition at line 151 of file AIEVecUtils.h.
References flattenedStridedExpr().
std::unique_ptr< Pass > xilinx::aievec::createAIEVecConvolutionAnalysisPass | ( | ) |
Definition at line 610 of file FoldMulAddChainToConvOp.cpp.
std::unique_ptr< Pass > xilinx::aievec::createAIEVectorizePass | ( | ) |
Definition at line 3063 of file AIEVectorize.cpp.
std::unique_ptr< mlir::OperationPass< mlir::ModuleOp > > xilinx::aievec::createConvertAIEVecToLLVMPass | ( | ) |
Definition at line 2379 of file AIEVecToLLVM.cpp.
References createConvertAIEVecToLLVMPass().
Referenced by createConvertAIEVecToLLVMPass().
std::unique_ptr<::mlir::Pass > xilinx::aievec::createCopyRemovalPass | ( | ) |
Create a pass that removes unnecessary Copy operations.
Definition at line 244 of file CopyRemoval.cpp.
std::unique_ptr<::mlir::Pass > xilinx::aievec::createDynamicSizeNoImplicitBroadcastPass | ( | ) |
Definition at line 121 of file DynamicSizeNoImplicitBroadcast.cpp.
|
inline |
Definition at line 42 of file AIEVecUtils.h.
Referenced by ConvertMulFToAIEVecMulElemOpPattern::matchAndRewrite(), ConvertMulIToAIEVecMulElemOpPattern::matchAndRewrite(), ComputeSignedIntRightShiftOpPattern::matchAndRewrite(), LowerTruncOpPattern< SrcOpTy >::matchAndRewrite(), LowerVectorReductionAddIntOp::matchAndRewrite(), LowerVectorReductionAddBfloat16Op::matchAndRewrite(), FoldVectorExtractAndSplatToAIEBroadcast::matchAndRewrite(), and ConvertSplatToAIEBroadcast::matchAndRewrite().
void xilinx::aievec::encodeConf | ( | uint32_t | conf[2], |
const BufferParams & | x, | ||
const BufferParams & | z, | ||
bool | sub | ||
) |
Definition at line 200 of file AIEVecToLLVM.cpp.
References encodeSquare(), xilinx::aievec::BufferParams::square, and xilinx::aievec::BufferParams::step.
Referenced by xilinx::aievec::FMAOpConversion::matchAndRewrite(), xilinx::aievec::MulOpConversion::matchAndRewrite(), and xilinx::aievec::SelectOpConversion::matchAndRewrite().
uint32_t xilinx::aievec::encodeSquare | ( | uint32_t | square | ) |
Definition at line 189 of file AIEVecToLLVM.cpp.
Referenced by encodeConf(), and xilinx::aievec::SelectOpConversion::matchAndRewrite().
|
inline |
Definition at line 206 of file AIEVecUtils.h.
|
inline |
Definition at line 111 of file AIEVecUtils.h.
Referenced by constructLinearizedAffineExprForUPDOp().
|
inline |
Definition at line 49 of file AIEVecUtils.h.
Referenced by computeStartInAIEVec(), LongestConvMACChainAnalysis::getConvMacFromMulOp(), getVectorSizeInBits(), FoldMulAddChainToConvOpPattern::matchAndRewrite(), LowerVectorExtractStridedSliceOpAIEv1Pattern::matchAndRewrite(), LowerVectorExtractStridedSliceOpAIE2Pattern::matchAndRewrite(), and SplitUnalignedTransferReadPattern::matchAndRewrite().
mlir::VectorType xilinx::aievec::getFlattenedVectorType | ( | mlir::VectorType | vecTy | ) |
VectorType xilinx::aievec::getFlattenedVectorType | ( | VectorType | vecTy | ) |
|
inline |
Definition at line 31 of file AIEVecUtils.h.
std::string xilinx::aievec::getMulOrFMAIntrinsicName | ( | Operation * | op | ) |
Definition at line 161 of file AIEVecToLLVM.cpp.
References getVectorLaneSize(), and getVectorTypeString().
Referenced by xilinx::aievec::FMAOpConversion::matchAndRewrite(), and xilinx::aievec::MulOpConversion::matchAndRewrite().
std::optional< int64_t > xilinx::aievec::getTransferReadAlignmentOffset | ( | TransferReadLikeOp | readOp, |
mlir::VectorType | vType, | ||
int64_t | alignment | ||
) |
std::optional< int64_t > xilinx::aievec::getTransferReadAlignmentOffset | ( | TransferReadLikeOp | readOp, |
VectorType | vType, | ||
int64_t | alignment | ||
) |
template std::optional< int64_t > xilinx::aievec::getTransferReadAlignmentOffset | ( | vector::TransferReadOp | readOp, |
VectorType | vType, | ||
int64_t | alignment | ||
) |
template std::optional< int64_t > xilinx::aievec::getTransferReadAlignmentOffset | ( | vector::TransferReadOp::Adaptor | readOp, |
VectorType | vType, | ||
int64_t | alignment | ||
) |
|
inline |
Definition at line 55 of file AIEVecUtils.h.
Referenced by getMulOrFMAIntrinsicName(), getVectorSizeInBits(), getVectorTypeString(), xilinx::aievec::BroadcastScalarOpConversion::matchAndRewrite(), xilinx::aievec::ConcatOpConversion::matchAndRewrite(), xilinx::aievec::ExtractElemOpConversion::matchAndRewrite(), xilinx::aievec::ExtOpConversion::matchAndRewrite(), xilinx::aievec::MaxOpConversion::matchAndRewrite(), xilinx::aievec::MinOpConversion::matchAndRewrite(), xilinx::aievec::ShiftOpConversion::matchAndRewrite(), xilinx::aievec::SRSOpConversion::matchAndRewrite(), xilinx::aievec::UPDOpConversion::matchAndRewrite(), xilinx::aievec::UPSOpConversion::matchAndRewrite(), ConvertMulAddToAIEVecFMAElemOpPattern::matchAndRewrite(), ComputeSigmoidOpPattern::matchAndRewrite(), ConvertMulFToAIEVecMulElemOpPattern::matchAndRewrite(), ConvertMulIToAIEVecMulElemOpPattern::matchAndRewrite(), ComputeNegOpPattern::matchAndRewrite(), LowerVectorSelectOpToAIEVecSelOp::matchAndRewrite(), ComputeSignedIntRightShiftOpPattern::matchAndRewrite(), ComputeBxorAndBnegOpPattern::matchAndRewrite(), ComputeCeilOpPattern::matchAndRewrite(), ComputeErfOpPattern::matchAndRewrite(), ComputeFloorOpPattern::matchAndRewrite(), ComputeRsqrtOpPattern::matchAndRewrite(), ComputeSqrtOpPattern::matchAndRewrite(), ComputeTanhOpByLUTPattern::matchAndRewrite(), ComputeAbsOpPattern< SrcOpTy >::matchAndRewrite(), LowerVectorAddOrSubOpToAIEVecAddElemOrSubElemOp< SrcOpTy, DstOpTy >::matchAndRewrite(), LowerVectorMinMaxOpToAIEVecMinMaxOp< SrcOpTy, DstOpTy >::matchAndRewrite(), LowerVectorCmpOpToAIEVecCmpOp< SrcOpTy, CmpTy >::matchAndRewrite(), ComputeBandAndBorOpPattern< SrcOpTy, DstOpTy >::matchAndRewrite(), LowerTruncOpPattern< SrcOpTy >::matchAndRewrite(), ConvertVectorFMAOpToAIEVecFMAElemOpPattern::matchAndRewrite(), LowerVectorReductionMinOp::matchAndRewrite(), LowerVectorReductionMaxOp::matchAndRewrite(), LowerVectorReductionAddIntOp::matchAndRewrite(), LowerVectorReductionAddFloatOp::matchAndRewrite(), LowerVectorReductionAddBfloat16Op::matchAndRewrite(), FoldVectorExtractAndSplatToAIEBroadcast::matchAndRewrite(), ConvertSplatToAIEBroadcast::matchAndRewrite(), verifyMulFMAConvOp(), verifyMulFMAElemOp(), xilinx::aievec::aie1::verifyMulFMAOp(), and verifyPackUnpackOp().
|
inline |
Definition at line 80 of file AIEVecUtils.h.
References xilinx::AIE2.
Referenced by ConvertMulAddToAIEVecFMAOpPattern::matchAndRewrite(), ConvertMulAddToAIEVecFMAElemOpPattern::matchAndRewrite(), ConvertMulFToAIEVecMulElemOpPattern::matchAndRewrite(), ConvertMulIToAIEVecMulElemOpPattern::matchAndRewrite(), LowerVectorMulIOpToAIEVecMulOp::matchAndRewrite(), ComputeNegOpPattern::matchAndRewrite(), ComputeSignedIntRightShiftOpPattern::matchAndRewrite(), ComputeExpOpByLUTLLVMPattern::matchAndRewrite(), ComputeExpOpByLUTPattern::matchAndRewrite(), LowerExtOpPattern< SrcOpTy >::matchAndRewrite(), LowerVectorAddOrSubOpToAIEVecAddElemOrSubElemOp< SrcOpTy, DstOpTy >::matchAndRewrite(), LowerTruncOpPattern< SrcOpTy >::matchAndRewrite(), and LowerVectorReductionAddBfloat16Op::matchAndRewrite().
|
inline |
Definition at line 66 of file AIEVecUtils.h.
References getElementSizeInBits(), and getVectorLaneSize().
Referenced by xilinx::aievec::UPDOpConversion::matchAndRewrite().
std::string xilinx::aievec::getVectorTypeString | ( | VectorType | type, |
bool | abbrev = false , |
||
bool | acc = false |
||
) |
Definition at line 148 of file AIEVecToLLVM.cpp.
References getVectorLaneSize().
Referenced by xilinx::aievec::SelectOpConversion::getIntrinsicName(), xilinx::aievec::PackOpConversion::getIntrinsicName(), xilinx::aievec::UPDOpConversion::getIntrinsicName(), getMulOrFMAIntrinsicName(), and xilinx::aievec::UPDOpConversion::matchAndRewrite().
|
inline |
Definition at line 73 of file AIEVecUtils.h.
|
inline |
Definition at line 235 of file AIEVecUtils.h.
Referenced by isAssumingNoImplicitBroadcastOfDynamicSizes(), and DynamicSizeNoImplicitBroadcastPattern::matchAndRewrite().
|
inline |
Definition at line 246 of file AIEVecUtils.h.
References isAssumingNoImplicitBroadcastOfDynamicSizes().
|
inline |
Definition at line 39 of file AIEVecUtils.h.
void xilinx::aievec::populateAIEVecConvOpTransformationPatterns | ( | mlir::RewritePatternSet & | patterns, |
mlir::AnalysisManager & | am, | ||
unsigned | shiftParam, | ||
TargetBackend | backend | ||
) |
void xilinx::aievec::populateAIEVecConvOpTransformationPatterns | ( | RewritePatternSet & | patterns, |
AnalysisManager & | am, | ||
unsigned | shiftParam, | ||
TargetBackend | backend | ||
) |
Definition at line 529 of file FoldMulAddChainToConvOp.cpp.
Referenced by AIEVecConvOpTransformationPass::runOnOperation().
void xilinx::aievec::populateAIEVecToLLVMConversionPatterns | ( | mlir::LLVMTypeConverter & | converter, |
mlir::RewritePatternSet & | patterns | ||
) |
void xilinx::aievec::populateAIEVecToLLVMConversionPatterns | ( | mlir::LLVMTypeConverter & | converter, |
mlir::RewritePatternSet & | patterns, | ||
Aie2Fp32Emulation | aie2Fp32EmulationOption | ||
) |
Definition at line 2323 of file AIEVecToLLVM.cpp.
References populateAIEVecToLLVMConversionPatterns().
void xilinx::aievec::registerAIEVecPipelines | ( | ) |
Register all pipelines for the AIE Vector dialect.
Definition at line 146 of file ConvertVectorToAIEVec.cpp.
References buildCanonicalizeVectorForAIEVec(), buildConvertVectorToAIEVec(), buildDynamicSizeNoImplicitBroadcastPass(), buildLowerVectorToAIEVec(), and buildOptimizeAIEVec().
Referenced by aieRegisterAllPasses().
void xilinx::aievec::registerAIEVecToCppTranslation | ( | ) |
Definition at line 43 of file TranslateRegistration.cpp.
References xilinx::AIE2, and translateAIEVecToCpp().
void xilinx::aievec::registerTransformDialectExtension | ( | mlir::DialectRegistry & | registry | ) |
mlir::LogicalResult xilinx::aievec::translateAIEVecToCpp | ( | mlir::Operation * | op, |
bool | aie2, | ||
mlir::raw_ostream & | os | ||
) |
Translates the AIE vector dialect MLIR to C++ code.
Referenced by aieTranslateAIEVecToCpp(), and registerAIEVecToCppTranslation().