12#ifndef AIE_DIALECT_AIEVEC_PIPELINES_PASSES_H
13#define AIE_DIALECT_AIEVEC_PIPELINES_PASSES_H
15#include "mlir/Pass/Pass.h"
16#include "mlir/Pass/PassOptions.h"
25 :
public mlir::PassPipelineOptions<CanonicalizeVectorForAIEVecOptions> {
29 "Select AIE version: \"aie\", \"aie2\", or \"aie2p\". This will "
30 "determine the vector size and available operations."),
31 llvm::cl::init(
"aie")};
33 *
this,
"bf16-emulation",
35 "Run f32 vector arithmetic on the bf16 datapath: multiplies and "
36 "transcendentals take inputs rounded to bf16, sums stay f32."),
37 llvm::cl::init(
false)};
42 :
public mlir::PassPipelineOptions<LowerVectorToAIEVecOptions> {
46 "Select AIE version: \"aie\", \"aie2\", or \"aie2p\". This will "
47 "determine the vector size and available operations."),
48 llvm::cl::init(
"aie")};
53 :
public mlir::PassPipelineOptions<OptimizeAIEVecOptions> {
57 "Select AIE version: \"aie\", \"aie2\", or \"aie2p\". This will "
58 "determine the vector size and available operations."),
59 llvm::cl::init(
"aie")};
62 llvm::cl::desc(
"Shift parameter for rounding and saturation"),
68 :
public mlir::PassPipelineOptions<ConvertVectorToAIEVecOptions> {
73 llvm::cl::desc(
"Shift parameter for rounding and saturation"),
77 llvm::cl::desc(
"Zero offset for indicating the location of zeroes in "
78 "convolution filter (useful for 16x16 scheme)"),
82 llvm::cl::desc(
"Duplication factor for each value in convolution filter "
83 "(useful in 8x8 scheme)"),
88 "Select AIE version: \"aie\", \"aie2\", or \"aie2p\". This will "
89 "determine the vector size and available operations."),
90 llvm::cl::init(
"aie")};
92 *
this,
"bf16-emulation",
94 "Run f32 vector arithmetic on the bf16 datapath: multiplies and "
95 "transcendentals take inputs rounded to bf16, sums stay f32."),
96 llvm::cl::init(
false)};
99 auto res = PassPipelineOptions::parseFromString(options);
102 canonicalizeOptions.aieTarget =
aieTarget;
116 return canonicalizeOptions;
120 return optimizeOptions;
std::unique_ptr<::mlir::Pass > createCopyRemovalPass()
Create a pass that removes unnecessary Copy operations.
void registerAIEVecPipelines()
Register all pipelines for the AIE Vector dialect.
std::unique_ptr<::mlir::Pass > createSplitVectorLoadUpsChainsPass()
Create a pass that splits vector.load + aievec.ups chains to reduce shuffle operations for AIE2p targ...
void buildLowerVectorToAIEVec(mlir::OpPassManager &pm, const LowerVectorToAIEVecOptions &options)
std::unique_ptr<::mlir::Pass > createBF16EmulationPass()
Create a pass that runs f32 vector arithmetic on the bf16 datapath: multiplies and transcendentals ta...
std::unique_ptr<::mlir::Pass > createDynamicSizeNoImplicitBroadcastPass()
void buildCanonicalizeVectorForAIEVec(mlir::OpPassManager &pm, const CanonicalizeVectorForAIEVecOptions &options)
void buildConvertVectorToAIEVec(mlir::OpPassManager &pm, const ConvertVectorToAIEVecOptions &options)
Adds the "convert-vector-to-aievec" pipeline to the OpPassManager.
void buildDynamicSizeNoImplicitBroadcastPass(mlir::OpPassManager &pm)
void buildOptimizeAIEVec(mlir::OpPassManager &pm, const OptimizeAIEVecOptions &options)
Options for the "canonicalize-vector-for-aievec" pipeline.
PassOptions::Option< bool > enableBF16Emulation
PassOptions::Option< std::string > aieTarget
Options for the "convert-vector-to-aievec" pipeline.
const LowerVectorToAIEVecOptions & getLowerVectorToAIEVecOptions() const
PassOptions::Option< unsigned > dupFactor
PassOptions::Option< std::string > aieTarget
PassOptions::Option< unsigned > zeroOffset
PassOptions::Option< unsigned > shiftParam
mlir::LogicalResult parseFromString(mlir::StringRef options)
const CanonicalizeVectorForAIEVecOptions & getCanonicalizeVectorForAIEVecOptions() const
PassOptions::Option< bool > enableBF16Emulation
const OptimizeAIEVecOptions & getOptimizeAIEVecOptions() const
Options for the "lower-vector-to-aievec" pipeline.
PassOptions::Option< std::string > aieTarget
Options for the "optimize-aievec" pipeline.
PassOptions::Option< unsigned > shiftParam
PassOptions::Option< std::string > aieTarget