#include "mlir/Pass/Pass.h" #include "src/Pass/Passes.hpp" namespace onnx_mlir { void initOMPasses() { // All passes implemented within onnx-mlir should register within this // function to make themselves available as a command-line option. mlir::registerPass("decompose-onnx", "Decompose ONNX operations into composition of other ONNX operations.", []() -> std::unique_ptr { return mlir::createDecomposeONNXToONNXPass(); }); mlir::registerPass("shape-inference", "Shape inference for frontend dialects.", []() -> std::unique_ptr { return mlir::createShapeInferencePass(); }); mlir::registerPass("constprop-onnx", "ConstProp ONNX operations into composition of other ONNX operations.", []() -> std::unique_ptr { return mlir::createConstPropONNXToONNXPass(); }); mlir::registerPass("attribute-promotion", "Promote constant operands to attributes.", []() -> std::unique_ptr { return mlir::createAttributePromotionPass(); }); mlir::registerPass("elide-constants", "Elide values of constant operations.", []() -> std::unique_ptr { return mlir::createElideConstantValuePass(); }); mlir::registerPass("enable-memory-pool", "Enable a memory pool for allocating internal MemRefs.", []() -> std::unique_ptr { return mlir::createKrnlEnableMemoryPoolPass(); }); mlir::registerPass("bundle-memory-pools", "Bundle memory pools of internal MemRefs into a single memory pool.", []() -> std::unique_ptr { return mlir::createKrnlBundleMemoryPoolsPass(); }); mlir::registerPass( "lower-krnl", "Lower Krnl dialect.", []() -> std::unique_ptr { return mlir::createLowerKrnlPass(); }); mlir::registerPass("lower-frontend", "Lower frontend ops to Krnl dialect.", []() -> std::unique_ptr { return mlir::createLowerToKrnlPass(); }); mlir::registerPass("elide-krnl-constants", "Elide the constant values of the Global Krnl operations.", []() -> std::unique_ptr { return mlir::createElideConstGlobalValuePass(); }); mlir::registerPass("lower-all-llvm", "Lower the Krnl Affine and Std dialects to LLVM.", []() -> std::unique_ptr { return mlir::createKrnlLowerToLLVMPass(); }); mlir::registerPass("pack-krnl-constants", "Elide the constant values of the Global Krnl operations.", []() -> std::unique_ptr { return mlir::createPackKrnlGlobalConstantsPass(); }); } } // namespace onnx_mlir