14#ifndef AIE_DIALECT_AIEVEC_PIPELINES_PASSES_H
15#define AIE_DIALECT_AIEVEC_PIPELINES_PASSES_H
17#include "mlir/Pass/Pass.h"
18#include "mlir/Pass/PassOptions.h"
41 :
public mlir::PassPipelineOptions<CanonicalizeVectorForAIEVecOptions> {
44 llvm::cl::desc(
"Select AIE version: \"aie\" or \"aie2\". This will "
45 "determine the vector size and available operations."),
46 llvm::cl::init(
"aie")};
48 *
this,
"target-backend",
49 llvm::cl::desc(
"Select translation backend: \"cpp\" or \"llvmir\". This "
50 "will determine the aievec operations used to convert "
51 "from vector dialect."),
52 llvm::cl::init(
"cpp")};
57 :
public mlir::PassPipelineOptions<LowerVectorToAIEVecOptions> {
60 llvm::cl::desc(
"Select AIE version: \"aie\" or \"aie2\". This will "
61 "determine the vector size and available operations."),
62 llvm::cl::init(
"aie")};
64 *
this,
"target-backend",
65 llvm::cl::desc(
"Select translation backend: \"cpp\" or \"llvmir\". This "
66 "will determine the aievec operations used to convert "
67 "from vector dialect."),
68 llvm::cl::init(
"cpp")};
73 :
public mlir::PassPipelineOptions<OptimizeAIEVecOptions> {
76 llvm::cl::desc(
"Select AIE version: \"aie\" or \"aie2\". This will "
77 "determine the vector size and available operations."),
78 llvm::cl::init(
"aie")};
80 *
this,
"target-backend",
81 llvm::cl::desc(
"Select translation backend: \"cpp\" or \"llvmir\". This "
82 "will determine the aievec operations used to convert "
83 "from vector dialect."),
84 llvm::cl::init(
"cpp")};
87 llvm::cl::desc(
"Shift parameter for rounding and saturation"),
93 :
public mlir::PassPipelineOptions<ConvertVectorToAIEVecOptions> {
98 llvm::cl::desc(
"Shift parameter for rounding and saturation"),
101 *
this,
"zero-offset",
102 llvm::cl::desc(
"Zero offset for indicating the location of zeroes in "
103 "convolution filter (useful for 16x16 scheme)"),
107 llvm::cl::desc(
"Duplication factor for each value in convolution filter "
108 "(useful in 8x8 scheme)"),
112 llvm::cl::desc(
"Select AIE version: \"aie\" or \"aie2\". This will "
113 "determine the vector size and available operations."),
114 llvm::cl::init(
"aie")};
116 *
this,
"target-backend",
117 llvm::cl::desc(
"Select translation backend: \"cpp\" or \"llvmir\". This "
118 "will determine the aievec operations used to convert "
119 "from vector dialect."),
120 llvm::cl::init(
"cpp")};
123 auto res = PassPipelineOptions::parseFromString(options);
142 return canonicalizeOptions;
146 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.
void buildLowerVectorToAIEVec(mlir::OpPassManager &pm, const LowerVectorToAIEVecOptions &options)
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< std::string > targetBackend
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< std::string > targetBackend
PassOptions::Option< unsigned > zeroOffset
PassOptions::Option< unsigned > shiftParam
mlir::LogicalResult parseFromString(mlir::StringRef options)
const CanonicalizeVectorForAIEVecOptions & getCanonicalizeVectorForAIEVecOptions() const
const OptimizeAIEVecOptions & getOptimizeAIEVecOptions() const
Options for the "lower-vector-to-aievec" pipeline.
PassOptions::Option< std::string > aieTarget
PassOptions::Option< std::string > targetBackend
Options for the "optimize-aievec" pipeline.
PassOptions::Option< unsigned > shiftParam
PassOptions::Option< std::string > targetBackend
PassOptions::Option< std::string > aieTarget