diff --git a/src/Accelerators/NNPA/Compiler/NNPACompilerUtils.cpp b/src/Accelerators/NNPA/Compiler/NNPACompilerUtils.cpp index 19e94c22cb..fb7c04a4a3 100644 --- a/src/Accelerators/NNPA/Compiler/NNPACompilerUtils.cpp +++ b/src/Accelerators/NNPA/Compiler/NNPACompilerUtils.cpp @@ -101,6 +101,17 @@ void addONNXToZHighPasses( if (isBE) pm.addNestedPass( onnx_mlir::zhigh::createZHighConstPropagationPass()); + // One more call to ONNX shape inference/canonicalization/... to update shape + // if possible. + if (enableONNXHybridPass) { + // For starters only illustrating the new hybrid pass by replacing 3 passes + // here. The plan is to replace most of the passes in addONNXToMLIRPasses. + pm.addNestedPass(onnx_mlir::createONNXHybridTransformPass()); + } else { + pm.addNestedPass(onnx_mlir::createShapeInferencePass()); + pm.addPass(mlir::createCanonicalizerPass()); + pm.addNestedPass(onnx_mlir::createShapeInferencePass()); + } // Remove common sub-expressions. pm.addPass(mlir::createCSEPass());