Skip to content

Commit

Permalink
Refactor(Best gain): Init best gain out of cuts loop
Browse files Browse the repository at this point in the history
  • Loading branch information
wjrforcyber committed Dec 19, 2024
1 parent f2396ec commit d337a5f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/mockturtle/algorithms/cut_rewriting.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) ) )
{
Expand All @@ -454,7 +456,6 @@ class cut_rewriting_with_compatibility_graph_impl
int32_t value = recursive_deref<Ntk, NodeCostFn>( 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 );
Expand Down

0 comments on commit d337a5f

Please sign in to comment.