From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7880) id D6E323858C60; Thu, 16 Feb 2023 16:27:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D6E323858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676564865; bh=/m6GX3pDfdTeo7/GTUya9g1I7z1OCg9KPVw2BRCD800=; h=From:To:Subject:Date:From; b=KWUdQdyuIojQ6iOhDbGhtgZdkIJGSTuf2Lv52y1zbWj7thNDJhGuaZXhiW0qCjfgd ZYKSxOuqNwi06oQl2fVvp53iC3G8Ka4i9mk4J8xVob54XBZcb4YJFM6x8vij4CWnDn lGyMqdha9UVG/mh7SHVdyeqlwJ84pgakLADr9phs= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Ondrej Kubanek To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/kubaneko/heads/histogram)] add loop_optimizer_init X-Act-Checkin: gcc X-Git-Author: kubaneko X-Git-Refname: refs/users/kubaneko/heads/histogram X-Git-Oldrev: 4d451bad79dfe9ccaa0bafca461f65d7c28b720c X-Git-Newrev: 77959cb79b046bb7912e5c36c37d2f0fe1eedaa2 Message-Id: <20230216162745.D6E323858C60@sourceware.org> Date: Thu, 16 Feb 2023 16:27:45 +0000 (GMT) List-Id: https://gcc.gnu.org/g:77959cb79b046bb7912e5c36c37d2f0fe1eedaa2 commit 77959cb79b046bb7912e5c36c37d2f0fe1eedaa2 Author: kubaneko Date: Tue Sep 27 12:47:59 2022 +0000 add loop_optimizer_init Diff: --- gcc/profile.cc | 5 +++++ gcc/value-prof.cc | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gcc/profile.cc b/gcc/profile.cc index 987b764baf5..297f335a439 100644 --- a/gcc/profile.cc +++ b/gcc/profile.cc @@ -1206,6 +1206,9 @@ branch_prob (bool thunk) total_num_times_called++; + calculate_dominance_info (CDI_DOMINATORS); + loop_optimizer_init (LOOPS_HAVE_SIMPLE_LATCHES); + flow_call_edges_add (NULL); add_noreturn_fake_exit_edges (); @@ -1591,6 +1594,8 @@ branch_prob (bool thunk) } compute_function_frequency (); } + loop_optimizer_finalize (); + free_dominance_info (CDI_DOMINATORS); } /* Union find algorithm implementation for the basic blocks using diff --git a/gcc/value-prof.cc b/gcc/value-prof.cc index c4dbd0226b5..fad7967a869 100644 --- a/gcc/value-prof.cc +++ b/gcc/value-prof.cc @@ -1930,11 +1930,11 @@ gimple_stringops_values_to_profile (gimple *gs, histogram_values *values) static void gimple_histogram_values_to_profile(function *fun, histogram_values * values){ - calculate_dominance_info (CDI_DOMINATORS); for (auto loop : loops_list (fun, 0)){ tree var; gimple_stmt_iterator gsi; - gsi = gsi_last_bb (loop->latch); + + gsi = gsi_start_bb (loop->latch); create_iv (build_int_cst_type (get_gcov_type(), 0), build_int_cst (get_gcov_type(), 1), NULL_TREE, loop, &gsi, true, &var, NULL); auto_vec exits = get_loop_exit_edges (loop); @@ -1946,7 +1946,6 @@ gimple_histogram_values_to_profile(function *fun, histogram_values * values){ } } } - free_dominance_info (CDI_DOMINATORS); gsi_commit_edge_inserts (); }