public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/kubaneko/heads/histogram)] repaired copy header for histograms
@ 2023-04-08 21:06 Ondrej Kubanek
  0 siblings, 0 replies; only message in thread
From: Ondrej Kubanek @ 2023-04-08 21:06 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:e59f582bbbba9ea4f27265971e1867e02c391d85

commit e59f582bbbba9ea4f27265971e1867e02c391d85
Author: kubaneko <kubanek0ondrej@gmail.com>
Date:   Fri Apr 7 19:34:43 2023 +0000

    repaired copy header for histograms

Diff:
---
 gcc/tree-ssa-loop-ch.cc | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/gcc/tree-ssa-loop-ch.cc b/gcc/tree-ssa-loop-ch.cc
index ddf025c0cfd..919ecc29d2c 100644
--- a/gcc/tree-ssa-loop-ch.cc
+++ b/gcc/tree-ssa-loop-ch.cc
@@ -455,6 +455,7 @@ ch_base::copy_headers (function *fun)
 
       exit = NULL;
       n_bbs = 0;
+      // auto prob_enters_loop=profile_probability::guessed_always();
       while (should_duplicate_loop_header_p (header, loop, &remaining_limit))
 	{
 	  if (dump_file && (dump_flags & TDF_DETAILS))
@@ -466,9 +467,12 @@ ch_base::copy_headers (function *fun)
 	    exit = EDGE_SUCC (header, 0);
 	  else
 	    exit = EDGE_SUCC (header, 1);
+      // if (exit){
+      //       prob_enters_loop*=exit->probability;
+      // }
 	  bbs[n_bbs++] = header;
 	  gcc_assert (bbs_size > n_bbs);
-	  header = exit->dest;
+      header = exit->dest;
 	}
 
       if (!exit)
@@ -555,6 +559,11 @@ ch_base::copy_headers (function *fun)
 	    fprintf (dump_file, "Loop %d is still not do-while loop.\n",
 		     loop->num);
 	}
+      // if it is unlikely that after header copy the iterations enter the loop it
+      // behaves like peeling 1 time
+      // if (prob_enters_loop<profile_probability::very_unlikely() || remaining_limit>=0){
+      //     adjust_loop_estimates_minus(loop, 1);
+      // }
 
       changed = true;
     }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-08 21:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-08 21:06 [gcc(refs/users/kubaneko/heads/histogram)] repaired copy header for histograms 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).