[gcc(refs/users/kubaneko/heads/histogram)] add loop_optimizer_init
Ondrej Kubanek
kubaneko@gcc.gnu.org
Wed Sep 28 15:31:05 GMT 2022
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);
}
/* 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 ();
}
More information about the Gcc-cvs
mailing list