public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/loop-unswitch-improvement-v7)] Fix coding style.
@ 2021-12-08 18:27 Martin Liska
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Liska @ 2021-12-08 18:27 UTC (permalink / raw)
  To: gcc-cvs

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

commit b0015301de63c42c8ca81e12cebf082a9d4b4d00
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;
     }


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

* [gcc(refs/users/marxin/heads/loop-unswitch-improvement-v7)] Fix coding style.
@ 2021-12-09 12:49 Martin Liska
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Liska @ 2021-12-09 12:49 UTC (permalink / raw)
  To: gcc-cvs

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;
     }


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

* [gcc(refs/users/marxin/heads/loop-unswitch-improvement-v7)] Fix coding style.
@ 2021-12-08 11:29 Martin Liska
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Liska @ 2021-12-08 11:29 UTC (permalink / raw)
  To: gcc-cvs

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

commit e93bcb4221e9fc88026d1e48446f16302331cbe9
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 d80b34db861..99157f1ff71 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -155,7 +155,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.  */
 
@@ -396,8 +396,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 ();
 	}
 
@@ -419,7 +420,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;
@@ -463,9 +464,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 ())
 		    {
@@ -482,6 +484,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)
 {
@@ -494,8 +499,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;
@@ -503,6 +508,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)
@@ -523,7 +530,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;
 	}
     }
@@ -608,8 +616,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);
@@ -621,7 +629,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;
     }


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

end of thread, other threads:[~2021-12-09 12:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-08 18:27 [gcc(refs/users/marxin/heads/loop-unswitch-improvement-v7)] Fix coding style Martin Liska
  -- strict thread matches above, loose matches on Subject: below --
2021-12-09 12:49 Martin Liska
2021-12-08 11:29 Martin Liska

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).