diff --git a/src/Transform/ONNX/ConstProp.cpp b/src/Transform/ONNX/ConstProp.cpp index 14c3633d38..b80b9c9ba8 100644 --- a/src/Transform/ONNX/ConstProp.cpp +++ b/src/Transform/ONNX/ConstProp.cpp @@ -1013,12 +1013,6 @@ class SplitOfConst : public OpRewritePattern { } }; -void getPatterns(RewritePatternSet &patterns) { - populateWithGenerated(patterns); - if (isNotDisabled("SplitOfConst")) - patterns.insert(patterns.getContext()); -} - //===----------------------------------------------------------------------===// // Code to manage the pass. //===----------------------------------------------------------------------===// @@ -1042,7 +1036,7 @@ void ConstPropONNXToONNXPass::runOnOperation() { MLIRContext *context = &getContext(); RewritePatternSet patterns(context); - getPatterns(patterns); + getConstPropPatterns(patterns); if (failed(applyPatternsAndFoldGreedily(function, std::move(patterns)))) signalPassFailure(); } @@ -1050,7 +1044,9 @@ void ConstPropONNXToONNXPass::runOnOperation() { } // end anonymous namespace. void onnx_mlir::getConstPropPatterns(RewritePatternSet &patterns) { - getPatterns(patterns); + populateWithGenerated(patterns); + if (isNotDisabled("SplitOfConst")) + patterns.insert(patterns.getContext()); } void onnx_mlir::configureConstPropONNXToONNXPass(