public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/kubaneko/heads/histogram)] add loop_optimizer_init
@ 2023-02-16 16:27 Ondrej Kubanek
  0 siblings, 0 replies; 3+ messages in thread
From: Ondrej Kubanek @ 2023-02-16 16:27 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:77959cb79b046bb7912e5c36c37d2f0fe1eedaa2

commit 77959cb79b046bb7912e5c36c37d2f0fe1eedaa2
Author: kubaneko <kubanek0ondrej@gmail.com>
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);
 }
 \f
 /* 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<edge> 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 ();
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gcc(refs/users/kubaneko/heads/histogram)] add loop_optimizer_init
@ 2023-02-23 23:21 Ondrej Kubanek
  0 siblings, 0 replies; 3+ messages in thread
From: Ondrej Kubanek @ 2023-02-23 23:21 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:158017f839421c3b8b337fa400224bb0c3f3db02

commit 158017f839421c3b8b337fa400224bb0c3f3db02
Author: kubaneko <kubanek0ondrej@gmail.com>
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 9cab798f736..d571791f1a8 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 ();
 
@@ -1593,6 +1596,8 @@ branch_prob (bool thunk)
 	  }
       compute_function_frequency ();
     }
+   loop_optimizer_finalize ();
+   free_dominance_info (CDI_DOMINATORS);
 }
 \f
 /* Union find algorithm implementation for the basic blocks using
diff --git a/gcc/value-prof.cc b/gcc/value-prof.cc
index 1eca1b79173..3a1dbd90a07 100644
--- a/gcc/value-prof.cc
+++ b/gcc/value-prof.cc
@@ -1929,11 +1929,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<edge> exits = get_loop_exit_edges (loop);
@@ -1945,7 +1945,6 @@ gimple_histogram_values_to_profile(function *fun, histogram_values * values){
                  }
          }
     }
-    free_dominance_info (CDI_DOMINATORS);
     gsi_commit_edge_inserts ();
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gcc(refs/users/kubaneko/heads/histogram)] add loop_optimizer_init
@ 2022-09-28 15:31 Ondrej Kubanek
  0 siblings, 0 replies; 3+ messages in thread
From: Ondrej Kubanek @ 2022-09-28 15:31 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:97ceb05c9251922d918c8eb7d9a267d120b48323

commit 97ceb05c9251922d918c8eb7d9a267d120b48323
Author: kubaneko <kubanek0ondrej@gmail.com>
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);
 }
 \f
 /* 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<edge> 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 ();
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-23 23:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-16 16:27 [gcc(refs/users/kubaneko/heads/histogram)] add loop_optimizer_init Ondrej Kubanek
  -- strict thread matches above, loose matches on Subject: below --
2023-02-23 23:21 Ondrej Kubanek
2022-09-28 15:31 Ondrej Kubanek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).