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"
34 :
public mlir::PassPipelineOptions<CanonicalizeVectorForAIEVecOptions> {
37 llvm::cl::desc(
"Select AIE version: \"aie\" or \"aie2\". This will "
38 "determine the vector size and available operations."),
39 llvm::cl::init(
"aie")};
41 *
this,
"bf16-emulation",
43 "Run f32 vector arithmetic on the bf16 datapath: multiplies and "
44 "transcendentals take inputs rounded to bf16, sums stay f32."),
45 llvm::cl::init(
false)};
50 :
public mlir::PassPipelineOptions<LowerVectorToAIEVecOptions> {
53 llvm::cl::desc(
"Select AIE version: \"aie\" or \"aie2\". This will "
54 "determine the vector size and available operations."),
55 llvm::cl::init(
"aie")};
60 :
public mlir::PassPipelineOptions<OptimizeAIEVecOptions> {
63 llvm::cl::desc(
"Select AIE version: \"aie\" or \"aie2\". This will "
64 "determine the vector size and available operations."),
65 llvm::cl::init(
"aie")};
68 llvm::cl::desc(
"Shift parameter for rounding and saturation"),
74 :
public mlir::PassPipelineOptions<ConvertVectorToAIEVecOptions> {
79 llvm::cl::desc(
"Shift parameter for rounding and saturation"),
83 llvm::cl::desc(
"Zero offset for indicating the location of zeroes in "
84 "convolution filter (useful for 16x16 scheme)"),
88 llvm::cl::desc(
"Duplication factor for each value in convolution filter "
89 "(useful in 8x8 scheme)"),
93 llvm::cl::desc(
"Select AIE version: \"aie\" or \"aie2\". This will "
94 "determine the vector size and available operations."),
95 llvm::cl::init(
"aie")};
97 *
this,
"bf16-emulation",
99 "Run f32 vector arithmetic on the bf16 datapath: multiplies and "
100 "transcendentals take inputs rounded to bf16, sums stay f32."),
101 llvm::cl::init(
false)};
104 auto res = PassPipelineOptions::parseFromString(options);
107 canonicalizeOptions.aieTarget =
aieTarget;
121 return canonicalizeOptions;
125 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