public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] phiopt: Use gphi *phi instead of gimple *phi some more
@ 2021-05-06  8:34 Jakub Jelinek
  2021-05-06 10:13 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2021-05-06  8:34 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

Hi!

Various functions in phiopt are also called with a gphi * but use
gimple * argument for it.  Fixed thusly, bootstrapped/regtested on
x86_64-linux and i686-linux, ok for trunk?

2021-05-06  Jakub Jelinek  <jakub@redhat.com>

	* tree-ssa-phiopt.c (value_replacement, minmax_replacement,
	abs_replacement, xor_replacement,
	cond_removal_in_popcount_clz_ctz_pattern,
	replace_phi_edge_with_variable): Change type of phi argument from
	gimple * to gphi *.

--- gcc/tree-ssa-phiopt.c.jj	2021-05-05 15:06:23.253189139 +0200
+++ gcc/tree-ssa-phiopt.c	2021-05-05 18:02:07.600019038 +0200
@@ -57,23 +57,23 @@ static bool conditional_replacement (bas
 static gphi *factor_out_conditional_conversion (edge, edge, gphi *, tree, tree,
 						gimple *);
 static int value_replacement (basic_block, basic_block,
-			      edge, edge, gimple *, tree, tree);
+			      edge, edge, gphi *, tree, tree);
 static bool minmax_replacement (basic_block, basic_block,
-				edge, edge, gimple *, tree, tree);
+				edge, edge, gphi *, tree, tree);
 static bool abs_replacement (basic_block, basic_block,
-			     edge, edge, gimple *, tree, tree);
+			     edge, edge, gphi *, tree, tree);
 static bool xor_replacement (basic_block, basic_block,
-			     edge, edge, gimple *, tree, tree);
+			     edge, edge, gphi *, tree, tree);
 static bool spaceship_replacement (basic_block, basic_block,
 				   edge, edge, gphi *, tree, tree);
 static bool cond_removal_in_popcount_clz_ctz_pattern (basic_block, basic_block,
-						      edge, edge, gimple *,
+						      edge, edge, gphi *,
 						      tree, tree);
 static bool cond_store_replacement (basic_block, basic_block, edge, edge,
 				    hash_set<tree> *);
 static bool cond_if_else_store_replacement (basic_block, basic_block, basic_block);
 static hash_set<tree> * get_non_trapping ();
-static void replace_phi_edge_with_variable (basic_block, edge, gimple *, tree);
+static void replace_phi_edge_with_variable (basic_block, edge, gphi *, tree);
 static void hoist_adjacent_loads (basic_block, basic_block,
 				  basic_block, basic_block);
 static bool gate_hoist_loads (void);
@@ -389,7 +389,7 @@ tree_ssa_phiopt_worker (bool do_store_el
 
 static void
 replace_phi_edge_with_variable (basic_block cond_block,
-				edge e, gimple *phi, tree new_tree)
+				edge e, gphi *phi, tree new_tree)
 {
   basic_block bb = gimple_bb (phi);
   basic_block block_to_remove;
@@ -1113,8 +1113,7 @@ absorbing_element_p (tree_code code, tre
 
 static int
 value_replacement (basic_block cond_bb, basic_block middle_bb,
-		   edge e0, edge e1, gimple *phi,
-		   tree arg0, tree arg1)
+		   edge e0, edge e1, gphi *phi, tree arg0, tree arg1)
 {
   gimple_stmt_iterator gsi;
   gimple *cond;
@@ -1422,8 +1421,7 @@ value_replacement (basic_block cond_bb,
 
 static bool
 minmax_replacement (basic_block cond_bb, basic_block middle_bb,
-		    edge e0, edge e1, gimple *phi,
-		    tree arg0, tree arg1)
+		    edge e0, edge e1, gphi *phi, tree arg0, tree arg1)
 {
   tree result;
   edge true_edge, false_edge;
@@ -2266,7 +2264,7 @@ spaceship_replacement (basic_block cond_
 static bool
 cond_removal_in_popcount_clz_ctz_pattern (basic_block cond_bb,
 					  basic_block middle_bb,
-					  edge e1, edge e2, gimple *phi,
+					  edge e1, edge e2, gphi *phi,
 					  tree arg0, tree arg1)
 {
   gimple *cond;
@@ -2424,7 +2422,7 @@ cond_removal_in_popcount_clz_ctz_pattern
 static bool
 abs_replacement (basic_block cond_bb, basic_block middle_bb,
 		 edge e0 ATTRIBUTE_UNUSED, edge e1,
-		 gimple *phi, tree arg0, tree arg1)
+		 gphi *phi, tree arg0, tree arg1)
 {
   tree result;
   gassign *new_stmt;
@@ -2548,7 +2546,7 @@ abs_replacement (basic_block cond_bb, ba
 static bool
 xor_replacement (basic_block cond_bb, basic_block middle_bb,
 		 edge e0 ATTRIBUTE_UNUSED, edge e1,
-		 gimple *phi, tree arg0, tree arg1)
+		 gphi *phi, tree arg0, tree arg1)
 {
   if (!INTEGRAL_TYPE_P (TREE_TYPE (arg1)))
     return false;

	Jakub


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

* Re: [PATCH] phiopt: Use gphi *phi instead of gimple *phi some more
  2021-05-06  8:34 [PATCH] phiopt: Use gphi *phi instead of gimple *phi some more Jakub Jelinek
@ 2021-05-06 10:13 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2021-05-06 10:13 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

On Thu, 6 May 2021, Jakub Jelinek wrote:

> Hi!
> 
> Various functions in phiopt are also called with a gphi * but use
> gimple * argument for it.  Fixed thusly, bootstrapped/regtested on
> x86_64-linux and i686-linux, ok for trunk?

Yes (obvious even).

Richard.

> 2021-05-06  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* tree-ssa-phiopt.c (value_replacement, minmax_replacement,
> 	abs_replacement, xor_replacement,
> 	cond_removal_in_popcount_clz_ctz_pattern,
> 	replace_phi_edge_with_variable): Change type of phi argument from
> 	gimple * to gphi *.
> 
> --- gcc/tree-ssa-phiopt.c.jj	2021-05-05 15:06:23.253189139 +0200
> +++ gcc/tree-ssa-phiopt.c	2021-05-05 18:02:07.600019038 +0200
> @@ -57,23 +57,23 @@ static bool conditional_replacement (bas
>  static gphi *factor_out_conditional_conversion (edge, edge, gphi *, tree, tree,
>  						gimple *);
>  static int value_replacement (basic_block, basic_block,
> -			      edge, edge, gimple *, tree, tree);
> +			      edge, edge, gphi *, tree, tree);
>  static bool minmax_replacement (basic_block, basic_block,
> -				edge, edge, gimple *, tree, tree);
> +				edge, edge, gphi *, tree, tree);
>  static bool abs_replacement (basic_block, basic_block,
> -			     edge, edge, gimple *, tree, tree);
> +			     edge, edge, gphi *, tree, tree);
>  static bool xor_replacement (basic_block, basic_block,
> -			     edge, edge, gimple *, tree, tree);
> +			     edge, edge, gphi *, tree, tree);
>  static bool spaceship_replacement (basic_block, basic_block,
>  				   edge, edge, gphi *, tree, tree);
>  static bool cond_removal_in_popcount_clz_ctz_pattern (basic_block, basic_block,
> -						      edge, edge, gimple *,
> +						      edge, edge, gphi *,
>  						      tree, tree);
>  static bool cond_store_replacement (basic_block, basic_block, edge, edge,
>  				    hash_set<tree> *);
>  static bool cond_if_else_store_replacement (basic_block, basic_block, basic_block);
>  static hash_set<tree> * get_non_trapping ();
> -static void replace_phi_edge_with_variable (basic_block, edge, gimple *, tree);
> +static void replace_phi_edge_with_variable (basic_block, edge, gphi *, tree);
>  static void hoist_adjacent_loads (basic_block, basic_block,
>  				  basic_block, basic_block);
>  static bool gate_hoist_loads (void);
> @@ -389,7 +389,7 @@ tree_ssa_phiopt_worker (bool do_store_el
>  
>  static void
>  replace_phi_edge_with_variable (basic_block cond_block,
> -				edge e, gimple *phi, tree new_tree)
> +				edge e, gphi *phi, tree new_tree)
>  {
>    basic_block bb = gimple_bb (phi);
>    basic_block block_to_remove;
> @@ -1113,8 +1113,7 @@ absorbing_element_p (tree_code code, tre
>  
>  static int
>  value_replacement (basic_block cond_bb, basic_block middle_bb,
> -		   edge e0, edge e1, gimple *phi,
> -		   tree arg0, tree arg1)
> +		   edge e0, edge e1, gphi *phi, tree arg0, tree arg1)
>  {
>    gimple_stmt_iterator gsi;
>    gimple *cond;
> @@ -1422,8 +1421,7 @@ value_replacement (basic_block cond_bb,
>  
>  static bool
>  minmax_replacement (basic_block cond_bb, basic_block middle_bb,
> -		    edge e0, edge e1, gimple *phi,
> -		    tree arg0, tree arg1)
> +		    edge e0, edge e1, gphi *phi, tree arg0, tree arg1)
>  {
>    tree result;
>    edge true_edge, false_edge;
> @@ -2266,7 +2264,7 @@ spaceship_replacement (basic_block cond_
>  static bool
>  cond_removal_in_popcount_clz_ctz_pattern (basic_block cond_bb,
>  					  basic_block middle_bb,
> -					  edge e1, edge e2, gimple *phi,
> +					  edge e1, edge e2, gphi *phi,
>  					  tree arg0, tree arg1)
>  {
>    gimple *cond;
> @@ -2424,7 +2422,7 @@ cond_removal_in_popcount_clz_ctz_pattern
>  static bool
>  abs_replacement (basic_block cond_bb, basic_block middle_bb,
>  		 edge e0 ATTRIBUTE_UNUSED, edge e1,
> -		 gimple *phi, tree arg0, tree arg1)
> +		 gphi *phi, tree arg0, tree arg1)
>  {
>    tree result;
>    gassign *new_stmt;
> @@ -2548,7 +2546,7 @@ abs_replacement (basic_block cond_bb, ba
>  static bool
>  xor_replacement (basic_block cond_bb, basic_block middle_bb,
>  		 edge e0 ATTRIBUTE_UNUSED, edge e1,
> -		 gimple *phi, tree arg0, tree arg1)
> +		 gphi *phi, tree arg0, tree arg1)
>  {
>    if (!INTEGRAL_TYPE_P (TREE_TYPE (arg1)))
>      return false;
> 
> 	Jakub
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)

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

end of thread, other threads:[~2021-05-06 10:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-06  8:34 [PATCH] phiopt: Use gphi *phi instead of gimple *phi some more Jakub Jelinek
2021-05-06 10:13 ` Richard Biener

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