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

https://gcc.gnu.org/g:26570e9dbc5bbfe56692514efc7641592b938a6f

commit 26570e9dbc5bbfe56692514efc7641592b938a6f
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)

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

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

https://gcc.gnu.org/g:223227bbe5c3eb087e782b758e9e188c8b052834

commit 223227bbe5c3eb087e782b758e9e188c8b052834
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 4293f7d3910..72673b1fbab 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 28686e086bf..bb95cdd491d 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)

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

* [gcc(refs/users/kubaneko/heads/histogram)] redo stuff
@ 2022-11-22 20:43 Ondrej Kubanek
  0 siblings, 0 replies; 3+ messages in thread
From: Ondrej Kubanek @ 2022-11-22 20:43 UTC (permalink / raw)
  To: gcc-cvs

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)

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

end of thread, other threads:[~2023-02-23 23:22 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:28 [gcc(refs/users/kubaneko/heads/histogram)] redo stuff Ondrej Kubanek
  -- strict thread matches above, loose matches on Subject: below --
2023-02-23 23:22 Ondrej Kubanek
2022-11-22 20:43 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).