From d337a5fcd0ddb62a1ac5ef0b7197f9f2a0403dd6 Mon Sep 17 00:00:00 2001 From: wjrforcyber Date: Thu, 19 Dec 2024 15:51:27 +0800 Subject: [PATCH] Refactor(Best gain): Init best gain out of cuts loop --- include/mockturtle/algorithms/cut_rewriting.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/mockturtle/algorithms/cut_rewriting.hpp b/include/mockturtle/algorithms/cut_rewriting.hpp index d58bbf8fd..9c9c8acac 100644 --- a/include/mockturtle/algorithms/cut_rewriting.hpp +++ b/include/mockturtle/algorithms/cut_rewriting.hpp @@ -433,6 +433,8 @@ class cut_rewriting_with_compatibility_graph_impl if ( mffc_size( ntk, n ) == 1 ) return true; + int32_t best_gain{ -1 }; + /* foreach cut */ for ( auto& cut : cuts.cuts( ntk.node_to_index( n ) ) ) { @@ -454,7 +456,6 @@ class cut_rewriting_with_compatibility_graph_impl int32_t value = recursive_deref( ntk, n ); { stopwatch t( st.time_rewriting ); - int32_t best_gain{ -1 }; const auto on_signal = [&]( auto const& f_new ) { auto [v, contains] = recursive_ref_contains( ntk.get_node( f_new ), n );