public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 01/12] ipa: IPA-SRA split detection simplification
@ 2022-11-12  1:44 Martin Jambor
  2022-11-16 10:49 ` Jan Hubicka
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Jambor @ 2022-11-12  1:44 UTC (permalink / raw)
  To: GCC Patches; +Cc: Jan Hubicka, Jan Hubicka

Hi,

I have noticed that the flag m_split_modifications_p of
ipa_param_body_adjustments is not really necessary as it has to
correspond to whether m_replacements is non-empty so this patch
removes it.  This also simplifies a bit some patches I work on.

Bootstrapped and tested on x86_64-linux.  OK for master?

Thanks,

Martin


gcc/ChangeLog:

2022-11-10  Martin Jambor  <mjambor@suse.cz>

	* ipa-param-manipulation.cc
	(ipa_param_body_adjustments::common_initialization): Do not set
	m_split_modifications_p.
	(ipa_param_body_adjustments::ipa_param_body_adjustments): Remove
	initializations of m_split_modifications_p.
	(ipa_param_body_adjustments::modify_call_stmt): Check that
	m_replacements is empty instead of m_split_modifications_p.
---
 gcc/ipa-param-manipulation.cc | 29 +++++++++++++----------------
 gcc/ipa-param-manipulation.h  |  4 ----
 2 files changed, 13 insertions(+), 20 deletions(-)

diff --git a/gcc/ipa-param-manipulation.cc b/gcc/ipa-param-manipulation.cc
index 23a8cb84d48..cee0e23f946 100644
--- a/gcc/ipa-param-manipulation.cc
+++ b/gcc/ipa-param-manipulation.cc
@@ -1378,7 +1378,6 @@ ipa_param_body_adjustments::common_initialization (tree old_fndecl,
 
 	  if (apm->op == IPA_PARAM_OP_SPLIT)
 	    {
-	      m_split_modifications_p = true;
 	      split[prev_index] = true;
 	      register_replacement (apm, new_parm);
 	    }
@@ -1472,10 +1471,10 @@ ipa_param_body_adjustments
 ::ipa_param_body_adjustments (vec<ipa_adjusted_param, va_gc> *adj_params,
 			      tree fndecl)
   : m_adj_params (adj_params), m_adjustments (NULL), m_reset_debug_decls (),
-    m_split_modifications_p (false), m_dead_stmts (), m_dead_ssas (),
-    m_dead_ssa_debug_equiv (), m_dead_stmt_debug_equiv (), m_fndecl (fndecl),
-    m_id (NULL), m_oparms (), m_new_decls (), m_new_types (), m_replacements (),
-    m_removed_decls (), m_removed_map (), m_method2func (false)
+    m_dead_stmts (), m_dead_ssas (), m_dead_ssa_debug_equiv (),
+    m_dead_stmt_debug_equiv (), m_fndecl (fndecl), m_id (NULL), m_oparms (),
+    m_new_decls (), m_new_types (), m_replacements (), m_removed_decls (),
+    m_removed_map (), m_method2func (false)
 {
   common_initialization (fndecl, NULL, NULL);
 }
@@ -1489,11 +1488,10 @@ ipa_param_body_adjustments
 ::ipa_param_body_adjustments (ipa_param_adjustments *adjustments,
 			      tree fndecl)
   : m_adj_params (adjustments->m_adj_params), m_adjustments (adjustments),
-    m_reset_debug_decls (), m_split_modifications_p (false), m_dead_stmts (),
-    m_dead_ssas (), m_dead_ssa_debug_equiv (), m_dead_stmt_debug_equiv (),
-    m_fndecl (fndecl), m_id (NULL), m_oparms (), m_new_decls (),
-    m_new_types (), m_replacements (), m_removed_decls (), m_removed_map (),
-    m_method2func (false)
+    m_reset_debug_decls (), m_dead_stmts (), m_dead_ssas (),
+    m_dead_ssa_debug_equiv (), m_dead_stmt_debug_equiv (), m_fndecl (fndecl),
+    m_id (NULL), m_oparms (), m_new_decls (), m_new_types (), m_replacements (),
+    m_removed_decls (), m_removed_map (), m_method2func (false)
 {
   common_initialization (fndecl, NULL, NULL);
 }
@@ -1513,11 +1511,10 @@ ipa_param_body_adjustments
 			      copy_body_data *id, tree *vars,
 			      vec<ipa_replace_map *, va_gc> *tree_map)
   : m_adj_params (adjustments->m_adj_params), m_adjustments (adjustments),
-    m_reset_debug_decls (), m_split_modifications_p (false), m_dead_stmts (),
-    m_dead_ssas (), m_dead_ssa_debug_equiv (), m_dead_stmt_debug_equiv (),
-    m_fndecl (fndecl), m_id (id), m_oparms (), m_new_decls (), m_new_types (),
-    m_replacements (), m_removed_decls (), m_removed_map (),
-    m_method2func (false)
+    m_reset_debug_decls (), m_dead_stmts (), m_dead_ssas (),
+    m_dead_ssa_debug_equiv (), m_dead_stmt_debug_equiv (), m_fndecl (fndecl),
+    m_id (id), m_oparms (), m_new_decls (), m_new_types (), m_replacements (),
+    m_removed_decls (), m_removed_map (), m_method2func (false)
 {
   common_initialization (old_fndecl, vars, tree_map);
 }
@@ -1979,7 +1976,7 @@ ipa_param_body_adjustments::modify_call_stmt (gcall **stmt_p,
 	  && m_dead_ssas.contains (t))
 	recreate = true;
 
-      if (!m_split_modifications_p)
+      if (m_replacements.is_empty ())
 	continue;
 
       tree base;
diff --git a/gcc/ipa-param-manipulation.h b/gcc/ipa-param-manipulation.h
index a9ad2b216be..e5654f4ff70 100644
--- a/gcc/ipa-param-manipulation.h
+++ b/gcc/ipa-param-manipulation.h
@@ -350,10 +350,6 @@ public:
 
   auto_vec<tree, 16> m_reset_debug_decls;
 
-  /* Set to true if there are any IPA_PARAM_OP_SPLIT adjustments among stored
-     adjustments.  */
-  bool m_split_modifications_p;
-
   /* Sets of statements and SSA_NAMEs that only manipulate data from parameters
      removed because they are not necessary.  */
   hash_set<gimple *> m_dead_stmts;
-- 
2.38.0


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

* Re: [PATCH 01/12] ipa: IPA-SRA split detection simplification
  2022-11-12  1:44 [PATCH 01/12] ipa: IPA-SRA split detection simplification Martin Jambor
@ 2022-11-16 10:49 ` Jan Hubicka
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Hubicka @ 2022-11-16 10:49 UTC (permalink / raw)
  To: Martin Jambor; +Cc: GCC Patches

> Hi,
> 
> I have noticed that the flag m_split_modifications_p of
> ipa_param_body_adjustments is not really necessary as it has to
> correspond to whether m_replacements is non-empty so this patch
> removes it.  This also simplifies a bit some patches I work on.
> 
> Bootstrapped and tested on x86_64-linux.  OK for master?
OK,
thanks!
Honza
> 
> Thanks,
> 
> Martin
> 
> 
> gcc/ChangeLog:
> 
> 2022-11-10  Martin Jambor  <mjambor@suse.cz>
> 
> 	* ipa-param-manipulation.cc
> 	(ipa_param_body_adjustments::common_initialization): Do not set
> 	m_split_modifications_p.
> 	(ipa_param_body_adjustments::ipa_param_body_adjustments): Remove
> 	initializations of m_split_modifications_p.
> 	(ipa_param_body_adjustments::modify_call_stmt): Check that
> 	m_replacements is empty instead of m_split_modifications_p.
> ---
>  gcc/ipa-param-manipulation.cc | 29 +++++++++++++----------------
>  gcc/ipa-param-manipulation.h  |  4 ----
>  2 files changed, 13 insertions(+), 20 deletions(-)
> 
> diff --git a/gcc/ipa-param-manipulation.cc b/gcc/ipa-param-manipulation.cc
> index 23a8cb84d48..cee0e23f946 100644
> --- a/gcc/ipa-param-manipulation.cc
> +++ b/gcc/ipa-param-manipulation.cc
> @@ -1378,7 +1378,6 @@ ipa_param_body_adjustments::common_initialization (tree old_fndecl,
>  
>  	  if (apm->op == IPA_PARAM_OP_SPLIT)
>  	    {
> -	      m_split_modifications_p = true;
>  	      split[prev_index] = true;
>  	      register_replacement (apm, new_parm);
>  	    }
> @@ -1472,10 +1471,10 @@ ipa_param_body_adjustments
>  ::ipa_param_body_adjustments (vec<ipa_adjusted_param, va_gc> *adj_params,
>  			      tree fndecl)
>    : m_adj_params (adj_params), m_adjustments (NULL), m_reset_debug_decls (),
> -    m_split_modifications_p (false), m_dead_stmts (), m_dead_ssas (),
> -    m_dead_ssa_debug_equiv (), m_dead_stmt_debug_equiv (), m_fndecl (fndecl),
> -    m_id (NULL), m_oparms (), m_new_decls (), m_new_types (), m_replacements (),
> -    m_removed_decls (), m_removed_map (), m_method2func (false)
> +    m_dead_stmts (), m_dead_ssas (), m_dead_ssa_debug_equiv (),
> +    m_dead_stmt_debug_equiv (), m_fndecl (fndecl), m_id (NULL), m_oparms (),
> +    m_new_decls (), m_new_types (), m_replacements (), m_removed_decls (),
> +    m_removed_map (), m_method2func (false)
>  {
>    common_initialization (fndecl, NULL, NULL);
>  }
> @@ -1489,11 +1488,10 @@ ipa_param_body_adjustments
>  ::ipa_param_body_adjustments (ipa_param_adjustments *adjustments,
>  			      tree fndecl)
>    : m_adj_params (adjustments->m_adj_params), m_adjustments (adjustments),
> -    m_reset_debug_decls (), m_split_modifications_p (false), m_dead_stmts (),
> -    m_dead_ssas (), m_dead_ssa_debug_equiv (), m_dead_stmt_debug_equiv (),
> -    m_fndecl (fndecl), m_id (NULL), m_oparms (), m_new_decls (),
> -    m_new_types (), m_replacements (), m_removed_decls (), m_removed_map (),
> -    m_method2func (false)
> +    m_reset_debug_decls (), m_dead_stmts (), m_dead_ssas (),
> +    m_dead_ssa_debug_equiv (), m_dead_stmt_debug_equiv (), m_fndecl (fndecl),
> +    m_id (NULL), m_oparms (), m_new_decls (), m_new_types (), m_replacements (),
> +    m_removed_decls (), m_removed_map (), m_method2func (false)
>  {
>    common_initialization (fndecl, NULL, NULL);
>  }
> @@ -1513,11 +1511,10 @@ ipa_param_body_adjustments
>  			      copy_body_data *id, tree *vars,
>  			      vec<ipa_replace_map *, va_gc> *tree_map)
>    : m_adj_params (adjustments->m_adj_params), m_adjustments (adjustments),
> -    m_reset_debug_decls (), m_split_modifications_p (false), m_dead_stmts (),
> -    m_dead_ssas (), m_dead_ssa_debug_equiv (), m_dead_stmt_debug_equiv (),
> -    m_fndecl (fndecl), m_id (id), m_oparms (), m_new_decls (), m_new_types (),
> -    m_replacements (), m_removed_decls (), m_removed_map (),
> -    m_method2func (false)
> +    m_reset_debug_decls (), m_dead_stmts (), m_dead_ssas (),
> +    m_dead_ssa_debug_equiv (), m_dead_stmt_debug_equiv (), m_fndecl (fndecl),
> +    m_id (id), m_oparms (), m_new_decls (), m_new_types (), m_replacements (),
> +    m_removed_decls (), m_removed_map (), m_method2func (false)
>  {
>    common_initialization (old_fndecl, vars, tree_map);
>  }
> @@ -1979,7 +1976,7 @@ ipa_param_body_adjustments::modify_call_stmt (gcall **stmt_p,
>  	  && m_dead_ssas.contains (t))
>  	recreate = true;
>  
> -      if (!m_split_modifications_p)
> +      if (m_replacements.is_empty ())
>  	continue;
>  
>        tree base;
> diff --git a/gcc/ipa-param-manipulation.h b/gcc/ipa-param-manipulation.h
> index a9ad2b216be..e5654f4ff70 100644
> --- a/gcc/ipa-param-manipulation.h
> +++ b/gcc/ipa-param-manipulation.h
> @@ -350,10 +350,6 @@ public:
>  
>    auto_vec<tree, 16> m_reset_debug_decls;
>  
> -  /* Set to true if there are any IPA_PARAM_OP_SPLIT adjustments among stored
> -     adjustments.  */
> -  bool m_split_modifications_p;
> -
>    /* Sets of statements and SSA_NAMEs that only manipulate data from parameters
>       removed because they are not necessary.  */
>    hash_set<gimple *> m_dead_stmts;
> -- 
> 2.38.0
> 

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

end of thread, other threads:[~2022-11-16 10:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-12  1:44 [PATCH 01/12] ipa: IPA-SRA split detection simplification Martin Jambor
2022-11-16 10:49 ` Jan Hubicka

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