public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Martin Liska <marxin@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/users/marxin/heads/loop-unswitch-improvement-v7)] Fix coding style.
Date: Thu,  9 Dec 2021 12:49:07 +0000 (GMT)	[thread overview]
Message-ID: <20211209124907.766B33858C39@sourceware.org> (raw)

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

commit e8c341dd2215abbaa0b6a342d77c922682082192
Author: Martin Liska <mliska@suse.cz>
Date:   Wed Dec 8 12:28:44 2021 +0100

    Fix coding style.

Diff:
---
 gcc/tree-ssa-loop-unswitch.c | 35 ++++++++++++++++++++++-------------
 1 file changed, 22 insertions(+), 13 deletions(-)

diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c
index 8a0feba862f..961c6f20478 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -156,7 +156,7 @@ static bool used_outside_loop_p (class loop *, tree);
 static void hoist_guard (class loop *, edge);
 static bool check_exit_phi (class loop *);
 static tree get_vop_from_header (class loop *);
-static void clean_up_after_unswitching (const auto_edge_flag &ignored_edge_flag);
+static void clean_up_after_unswitching (const auto_edge_flag &);
 
 /* Return vector of predicates that belong to a basic block.  */
 
@@ -397,8 +397,9 @@ find_unswitching_predicates_for_bb (basic_block bb, class loop *loop,
 
       if (irange::supports_type_p (TREE_TYPE (lhs)))
 	{
-	  ranger->gori().outgoing_edge_range_p (predicate->true_range, edge_true,
-						lhs, *get_global_range_query  ());
+	  ranger->gori ().outgoing_edge_range_p (predicate->true_range,
+						 edge_true, lhs,
+						 *get_global_range_query ());
 	  predicate->init_false_edge ();
 	}
 
@@ -420,7 +421,7 @@ find_unswitching_predicates_for_bb (basic_block bb, class loop *loop,
       /* Unswitching on undefined values would introduce undefined
 	 behavior that the original program might never exercise.  */
       if (is_maybe_undefined (idx, stmt, loop))
- 	return;
+	return;
 
       edge e;
       edge_iterator ei;
@@ -464,9 +465,10 @@ find_unswitching_predicates_for_bb (basic_block bb, class loop *loop,
 
 	      if (expr != NULL_TREE)
 		{
-		  unswitch_predicate *predicate = new unswitch_predicate (expr, idx, edge_index);
-		  ranger->gori().outgoing_edge_range_p (predicate->true_range, e,
-							idx, *get_global_range_query  ());
+		  unswitch_predicate *predicate
+		    = new unswitch_predicate (expr, idx, edge_index);
+		  ranger->gori ().outgoing_edge_range_p (predicate->true_range, e,
+							 idx, *get_global_range_query ());
 		  /* Huge switches are not supported by Ranger.  */
 		  if (predicate->true_range.undefined_p ())
 		    {
@@ -483,6 +485,9 @@ find_unswitching_predicates_for_bb (basic_block bb, class loop *loop,
     }
 }
 
+/* Merge ranges for the last item of PREDICATE_PATH with a predicate
+   that shared the same LHS.  */
+
 static void
 merge_last (predicate_vector &predicate_path)
 {
@@ -495,8 +500,8 @@ merge_last (predicate_vector &predicate_path)
 
       if (operand_equal_p (predicate->lhs, last_predicate->lhs, 0))
 	{
-	  irange &other
-	    = true_edge ? predicate->merged_true_range : predicate->merged_false_range;
+	  irange &other = (true_edge ? predicate->merged_true_range
+			   : predicate->merged_false_range);
 	  last_predicate->merged_true_range.intersect (other);
 	  last_predicate->merged_false_range.intersect (other);
 	  return;
@@ -504,6 +509,8 @@ merge_last (predicate_vector &predicate_path)
     }
 }
 
+/* Add PREDICATE to PREDICATE_PATH on TRUE_EDGE.  */
+
 static void
 add_predicate_to_path (predicate_vector &predicate_path,
 		       unswitch_predicate *predicate, bool true_edge)
@@ -524,7 +531,8 @@ find_range_for_lhs (predicate_vector &predicate_path, tree lhs,
 
       if (operand_equal_p (predicate->lhs, lhs, 0))
 	{
-	  range = true_edge ? predicate->merged_true_range : predicate->merged_false_range;
+	  range = (true_edge ? predicate->merged_true_range
+		   : predicate->merged_false_range);
 	  return true;
 	}
     }
@@ -609,8 +617,8 @@ evaluate_control_stmt_using_entry_checks (gimple *stmt,
 	  int_range_max r;
 	  int_range_max path_range;
 
-	  ranger->gori().outgoing_edge_range_p (r, e,
-						idx, *get_global_range_query  ());
+	  ranger->gori ().outgoing_edge_range_p (r, e, idx,
+						 *get_global_range_query ());
 	  if (find_range_for_lhs (predicate_path, idx, path_range))
 	    {
 	      r.intersect (path_range);
@@ -622,7 +630,8 @@ evaluate_control_stmt_using_entry_checks (gimple *stmt,
 	}
 
       /* Only one edge from the switch is alive.  */
-      if (ignored_edges->elements () + 1 == EDGE_COUNT (gimple_bb (swtch)->succs))
+      unsigned edge_count = EDGE_COUNT (gimple_bb (swtch)->succs);
+      if (ignored_edges->elements () + 1 == edge_count)
 	return result;
     }


             reply	other threads:[~2021-12-09 12:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09 12:49 Martin Liska [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-12-08 18:27 Martin Liska
2021-12-08 11:29 Martin Liska

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=20211209124907.766B33858C39@sourceware.org \
    --to=marxin@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).