public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Ondrej Kubanek <kubaneko@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/users/kubaneko/heads/histogram)] redo stuff
Date: Tue, 22 Nov 2022 20:43:24 +0000 (GMT)	[thread overview]
Message-ID: <20221122204324.5F28E3858C1F@sourceware.org> (raw)

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)

             reply	other threads:[~2022-11-22 20:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22 20:43 Ondrej Kubanek [this message]
2023-02-16 16:28 Ondrej Kubanek
2023-02-23 23:22 Ondrej Kubanek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221122204324.5F28E3858C1F@sourceware.org \
    --to=kubaneko@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).