Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions onnxoptimizer/pass_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// SPDX-License-Identifier: Apache-2.0

#include "onnxoptimizer/pass_manager.h"
#include "onnxoptimizer/passes/logging.h"

namespace ONNX_NAMESPACE {
namespace optimization {
Expand Down Expand Up @@ -36,10 +37,16 @@ std::shared_ptr<PassManagerAnalysis> FixedPointPassManager::run(Graph& graph) {
}
std::shared_ptr<CountBasedPassAnalysis> count_analysis =
std::static_pointer_cast<CountBasedPassAnalysis>(analysis);
if (count_analysis->num_positive_transforms != 0) {
VLOG(1) << "Pass " << pass->getPassName() << " transformed " << count_analysis->num_positive_transforms;
}

while (count_analysis->fixedPointOptimizationNeeded()) {
count_analysis = std::static_pointer_cast<CountBasedPassAnalysis>(
pass->runPass(graph));
if (count_analysis->num_positive_transforms != 0) {
VLOG(1) << "Pass " << pass->getPassName() << " transformed " << count_analysis->num_positive_transforms;
Comment on lines +41 to +48
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new VLOG statement is on a very long single line and likely won’t match the repository’s Google clang-format style (and may fail formatting/lint checks if enforced). Consider wrapping the stream expression across multiple lines (or using the existing Str(...) helper) to keep line lengths reasonable and consistent with the rest of the file.

Suggested change
VLOG(1) << "Pass " << pass->getPassName() << " transformed " << count_analysis->num_positive_transforms;
}
while (count_analysis->fixedPointOptimizationNeeded()) {
count_analysis = std::static_pointer_cast<CountBasedPassAnalysis>(
pass->runPass(graph));
if (count_analysis->num_positive_transforms != 0) {
VLOG(1) << "Pass " << pass->getPassName() << " transformed " << count_analysis->num_positive_transforms;
VLOG(1) << "Pass " << pass->getPassName()
<< " transformed "
<< count_analysis->num_positive_transforms;
}
while (count_analysis->fixedPointOptimizationNeeded()) {
count_analysis = std::static_pointer_cast<CountBasedPassAnalysis>(
pass->runPass(graph));
if (count_analysis->num_positive_transforms != 0) {
VLOG(1) << "Pass " << pass->getPassName()
<< " transformed "
<< count_analysis->num_positive_transforms;

Copilot uses AI. Check for mistakes.
Comment on lines +41 to +48
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same formatting issue as above: this VLOG statement is very long and should be wrapped to match the repo’s clang-format/Google style (or use Str(...) to build the message) for consistency and to avoid potential format-check failures.

Suggested change
VLOG(1) << "Pass " << pass->getPassName() << " transformed " << count_analysis->num_positive_transforms;
}
while (count_analysis->fixedPointOptimizationNeeded()) {
count_analysis = std::static_pointer_cast<CountBasedPassAnalysis>(
pass->runPass(graph));
if (count_analysis->num_positive_transforms != 0) {
VLOG(1) << "Pass " << pass->getPassName() << " transformed " << count_analysis->num_positive_transforms;
VLOG(1) << "Pass " << pass->getPassName()
<< " transformed "
<< count_analysis->num_positive_transforms;
}
while (count_analysis->fixedPointOptimizationNeeded()) {
count_analysis = std::static_pointer_cast<CountBasedPassAnalysis>(
pass->runPass(graph));
if (count_analysis->num_positive_transforms != 0) {
VLOG(1) << "Pass " << pass->getPassName()
<< " transformed "
<< count_analysis->num_positive_transforms;

Copilot uses AI. Check for mistakes.
}
fixed_point_optimization_done = true;
}
}
Expand Down
Loading