[gcc(refs/users/kubaneko/heads/histogram)] redo stuff
Ondrej Kubanek
kubaneko@gcc.gnu.org
Tue Nov 22 20:43:24 GMT 2022
https://gcc.gnu.org/g:41350905e16e7b08c50977e1751c4d157a30d72b
commit 41350905e16e7b08c50977e1751c4d157a30d72b
Author: kubaneko <kubanek0ondrej@gmail.com>
Date: Tue Nov 22 16:32:49 2022 +0000
redo stuff
Diff:
---
gcc/cfgloop.cc | 4 ++--
gcc/tree-ssa-loop-ivcanon.cc | 17 +++++++++++++++++
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/gcc/cfgloop.cc b/gcc/cfgloop.cc
index d014ef817eb..77c28179754 100644
--- a/gcc/cfgloop.cc
+++ b/gcc/cfgloop.cc
@@ -1773,8 +1773,8 @@ loop_preheader_edge (const class loop *loop)
edge e;
edge_iterator ei;
- // gcc_assert (loops_state_satisfies_p (LOOPS_HAVE_PREHEADERS)
- // && ! loops_state_satisfies_p (LOOPS_MAY_HAVE_MULTIPLE_LATCHES));
+ gcc_assert (loops_state_satisfies_p (LOOPS_HAVE_PREHEADERS)
+ && ! loops_state_satisfies_p (LOOPS_MAY_HAVE_MULTIPLE_LATCHES));
FOR_EACH_EDGE (e, ei, loop->header->preds)
if (e->src != loop->latch)
diff --git a/gcc/tree-ssa-loop-ivcanon.cc b/gcc/tree-ssa-loop-ivcanon.cc
index 2454600d138..c36efe28dc2 100644
--- a/gcc/tree-ssa-loop-ivcanon.cc
+++ b/gcc/tree-ssa-loop-ivcanon.cc
@@ -1035,6 +1035,23 @@ try_peel_loop (class loop *loop,
/* Check if there is an estimate on the number of iterations. */
npeel = estimated_loop_iterations_int (loop);
+
+ // linear part most common number
+ //bool histogram_peeling=loop->counters!=NULL;
+ //if (histogram_peeling){
+ // gcov_type max=0;
+ // int most_common=-1;
+ // for (int i=0;i<8; i++){
+ // if (loop->counters->hist[i]>=max){
+ // most_common=i;
+ // }
+ // }
+ // if (most_common>0)
+ // {
+ // npeel=most_common+1;
+ // }
+ //}
+
if (npeel < 0)
npeel = likely_max_loop_iterations_int (loop);
if (npeel < 0)
More information about the Gcc-cvs
mailing list