public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Sandra Loosemore <sloosemore@baylibre.com>
To: gcc-patches@gcc.gnu.org
Cc: jakub@redhat.com, tburnus@baylibre.com
Subject: [PATCH 10/12] OpenMP: Remove dead code from declare variant reimplementation
Date: Sat,  4 May 2024 15:21:50 -0600	[thread overview]
Message-ID: <20240504212153.3561429-11-sloosemore@baylibre.com> (raw)
In-Reply-To: <20240504212153.3561429-1-sloosemore@baylibre.com>

After reimplementing late resolution of "declare variant" to use the
same mechanisms as metadirective, the declare_variant_alt and
calls_declare_variant_alt flags on struct cgraph_node are no longer
used by anything.  For the purposes of marking functions that need
late resolution, the has_metadirectives flag has replaced
calls_declare_variant_alt.

Likewise struct omp_declare_variant_entry, struct
omp_declare_variant_base_entry, and the hash tables used to store
these structures are no longer needed, since the information needed for
late resolution is now stored in the gomp_metadirective nodes.

There are no functional changes in this patch, just removing dead code.

gcc/ChangeLog
	* cgraph.cc (symbol_table::create_edge): Don't set
	calls_declare_variant_alt in the caller.
	* cgraph.h (struct cgraph_node): Remove declare_variant_alt
	and calls_declare_variant_alt flags.
	* cgraphclones.cc (cgraph_node::create_clone): Don't copy
	calls_declare_variant_alt bit.
	* ipa-free-lang-data.cc (free_lang_data_in_decl): Adjust code
	referencing declare_variant_alt bit.
	* ipa.cc (symbol_table::remove_unreachable_nodes): Likewise.
	* lto-cgraph.cc (lto_output_node): Remove references to deleted
	bits.
	(output_refs): Adjust code referencing declare_variant_alt bit.
	(input_overwrite_node): Remove references to deleted bits.
	(input_refs): Adjust code referencing declare_variant_alt bit.
	* lto-streamer-out.cc (lto_output): Likewise.
	* lto-streamer.h (omp_lto_output_declare_variant_alt): Delete.
	(omp_lto_input_declare_variant_alt): Delete.
	* lto/lto-partition.cc (lto_balanced_map): Adjust code referencing
	deleted declare_variant_alt bit.
	* omp-expand.cc (expand_omp_target): Use has_metadirectives bit to
	trigger pass_omp_device_lower instead of calls_declare_variant_alt.
	* omp-general.cc (struct omp_declare_variant_entry): Delete.
	(struct omp_declare_variant_base_entry): Delete.
	(struct omp_declare_variant_hasher): Delete.
	(omp_declare_variant_hasher::hash): Delete.
	(omp_declare_variant_hasher::equal): Delete.
	(omp_declare_variants): Delete.
	(omp_declare_variant_alt_hasher): Delete.
	(omp_declare_variant_alt_hasher::hash): Delete.
	(omp_declare_variant_alt_hasher::equal): Delete.
	(omp_declare_variant_alt): Delete.
	(omp_lto_output_declare_variant_alt): Delete.
	(omp_lto_input_declare_variant_alt): Delete.
	(includes): Delete unnecessary include of gt-omp-general.h.
	* omp-offload.cc (execute_omp_device_lower): Remove references
	to deleted bit.
	(pass_omp_device_lower::gate): Likewise.
	* omp-simd-clone.cc (simd_clone_create): Likewise.
	* passes.cc (ipa_write_summaries): Likeise.
	* symtab.cc (symtab_node::get_partitioning_class): Likewise.
	* tree-inline.cc (expand_call_inline): Likewise.
	(tree_function_versioning): Likewise.
---
 gcc/cgraph.cc             |   2 -
 gcc/cgraph.h              |  11 +-
 gcc/cgraphclones.cc       |   1 -
 gcc/ipa-free-lang-data.cc |   2 +-
 gcc/ipa.cc                |   3 -
 gcc/lto-cgraph.cc         |  10 --
 gcc/lto-streamer-out.cc   |   3 +-
 gcc/lto-streamer.h        |   6 --
 gcc/lto/lto-partition.cc  |   5 +-
 gcc/omp-expand.cc         |   2 +-
 gcc/omp-general.cc        | 218 --------------------------------------
 gcc/omp-offload.cc        |   8 +-
 gcc/omp-simd-clone.cc     |   2 -
 gcc/passes.cc             |   3 +-
 gcc/symtab.cc             |   2 +-
 gcc/tree-inline.cc        |   4 -
 16 files changed, 10 insertions(+), 272 deletions(-)

diff --git a/gcc/cgraph.cc b/gcc/cgraph.cc
index 473d8410bc9..103bc2c0332 100644
--- a/gcc/cgraph.cc
+++ b/gcc/cgraph.cc
@@ -931,8 +931,6 @@ symbol_table::create_edge (cgraph_node *caller, cgraph_node *callee,
 				      caller->decl);
   else
     edge->in_polymorphic_cdtor = caller->thunk;
-  if (callee)
-    caller->calls_declare_variant_alt |= callee->declare_variant_alt;
 
   if (callee && symtab->state != LTO_STREAMING
       && edge->callee->comdat_local_p ())
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 6653ce19c3e..dd210842df7 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -897,10 +897,8 @@ struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : public symtab_node
       split_part (false), indirect_call_target (false), local (false),
       versionable (false), can_change_signature (false),
       redefined_extern_inline (false), tm_may_enter_irr (false),
-      ipcp_clone (false), declare_variant_alt (false),
-      calls_declare_variant_alt (false), gc_candidate (false),
-      called_by_ifunc_resolver (false),
-      has_metadirectives (false),
+      ipcp_clone (false), gc_candidate (false),
+      called_by_ifunc_resolver (false), has_metadirectives (false),
       m_uid (uid), m_summary_id (-1)
   {}
 
@@ -1491,11 +1489,6 @@ struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : public symtab_node
   unsigned tm_may_enter_irr : 1;
   /* True if this was a clone created by ipa-cp.  */
   unsigned ipcp_clone : 1;
-  /* True if this is the deferred declare variant resolution artificial
-     function.  */
-  unsigned declare_variant_alt : 1;
-  /* True if the function calls declare_variant_alt functions.  */
-  unsigned calls_declare_variant_alt : 1;
   /* True if the function should only be emitted if it is used.  This flag
      is set for local SIMD clones when they are created and cleared if the
      vectorizer uses them.  */
diff --git a/gcc/cgraphclones.cc b/gcc/cgraphclones.cc
index e6312b5c0ab..2b16730c10b 100644
--- a/gcc/cgraphclones.cc
+++ b/gcc/cgraphclones.cc
@@ -388,7 +388,6 @@ cgraph_node::create_clone (tree new_decl, profile_count prof_count,
   if (!new_inlined_to)
     prof_count = count.combine_with_ipa_count (prof_count);
   new_node->count = prof_count;
-  new_node->calls_declare_variant_alt = this->calls_declare_variant_alt;
   new_node->has_metadirectives = this->has_metadirectives;
 
   /* Update IPA profile.  Local profiles need no updating in original.  */
diff --git a/gcc/ipa-free-lang-data.cc b/gcc/ipa-free-lang-data.cc
index 3ad203fec4c..dc9f1f58e9e 100644
--- a/gcc/ipa-free-lang-data.cc
+++ b/gcc/ipa-free-lang-data.cc
@@ -575,7 +575,7 @@ free_lang_data_in_decl (tree decl, class free_lang_data_d *fld)
       if (!(node = cgraph_node::get (decl))
 	  || (!node->definition && !node->clones))
 	{
-	  if (node && !node->declare_variant_alt)
+	  if (node)
 	    node->release_body ();
 	  else
 	    {
diff --git a/gcc/ipa.cc b/gcc/ipa.cc
index c453fca5d9b..c2bf8d42407 100644
--- a/gcc/ipa.cc
+++ b/gcc/ipa.cc
@@ -451,9 +451,6 @@ symbol_table::remove_unreachable_nodes (FILE *file)
 			reachable.add (body);
 		      reachable.add (e->callee);
 		    }
-		  else if (e->callee->declare_variant_alt
-			   && !e->callee->in_other_partition)
-		    reachable.add (e->callee);
 		  enqueue_node (e->callee, &first, &reachable);
 		}
 
diff --git a/gcc/lto-cgraph.cc b/gcc/lto-cgraph.cc
index 5bd9916fd2c..a3dc76f219f 100644
--- a/gcc/lto-cgraph.cc
+++ b/gcc/lto-cgraph.cc
@@ -549,8 +549,6 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
   bp_pack_value (&bp, node->merged_extern_inline, 1);
   bp_pack_value (&bp, node->thunk, 1);
   bp_pack_value (&bp, node->parallelized_function, 1);
-  bp_pack_value (&bp, node->declare_variant_alt, 1);
-  bp_pack_value (&bp, node->calls_declare_variant_alt, 1);
   bp_pack_value (&bp, node->has_metadirectives, 1);
 
   /* Stream thunk info always because we use it in
@@ -781,9 +779,6 @@ output_refs (lto_symtab_encoder_t encoder)
 	  for (int i = 0; node->iterate_reference (i, ref); i++)
 	    lto_output_ref (ob, ref, encoder);
 	}
-      if (cgraph_node *cnode = dyn_cast <cgraph_node *> (node))
-	if (cnode->declare_variant_alt)
-	  omp_lto_output_declare_variant_alt (ob, cnode, encoder);
     }
 
   streamer_write_uhwi_stream (ob->main_stream, 0);
@@ -1251,8 +1246,6 @@ input_overwrite_node (struct lto_file_decl_data *file_data,
   node->merged_extern_inline = bp_unpack_value (bp, 1);
   node->thunk = bp_unpack_value (bp, 1);
   node->parallelized_function = bp_unpack_value (bp, 1);
-  node->declare_variant_alt = bp_unpack_value (bp, 1);
-  node->calls_declare_variant_alt = bp_unpack_value (bp, 1);
   node->has_metadirectives = bp_unpack_value (bp, 1);
   *has_thunk_info = bp_unpack_value (bp, 1);
   node->resolution = bp_unpack_enum (bp, ld_plugin_symbol_resolution,
@@ -1663,9 +1656,6 @@ input_refs (class lto_input_block *ib,
 	  input_ref (ib, node, nodes);
 	  count--;
 	}
-      if (cgraph_node *cnode = dyn_cast <cgraph_node *> (node))
-	if (cnode->declare_variant_alt)
-	  omp_lto_input_declare_variant_alt (ib, cnode, nodes);
     }
 }
 	    
diff --git a/gcc/lto-streamer-out.cc b/gcc/lto-streamer-out.cc
index d4f728094ed..42456d34823 100644
--- a/gcc/lto-streamer-out.cc
+++ b/gcc/lto-streamer-out.cc
@@ -2815,8 +2815,7 @@ lto_output (void)
 		  && flag_incremental_link != INCREMENTAL_LINK_LTO)
 	      /* Thunks have no body but they may be synthetized
 		 at WPA time.  */
-	      || DECL_ARGUMENTS (cnode->decl)
-	      || cnode->declare_variant_alt))
+	      || DECL_ARGUMENTS (cnode->decl)))
 	output_function (cnode);
       else if ((vnode = dyn_cast <varpool_node *> (snode))
 	       && (DECL_INITIAL (vnode->decl) != error_mark_node
diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h
index e8dbba471ed..895aa27692b 100644
--- a/gcc/lto-streamer.h
+++ b/gcc/lto-streamer.h
@@ -934,12 +934,6 @@ bool reachable_from_this_partition_p (struct cgraph_node *,
 lto_symtab_encoder_t compute_ltrans_boundary (lto_symtab_encoder_t encoder);
 void select_what_to_stream (void);
 
-/* In omp-general.cc.  */
-void omp_lto_output_declare_variant_alt (lto_simple_output_block *,
-					 cgraph_node *, lto_symtab_encoder_t);
-void omp_lto_input_declare_variant_alt (lto_input_block *, cgraph_node *,
-					vec<symtab_node *>);
-
 /* In options-save.cc.  */
 void cl_target_option_stream_out (struct output_block *, struct bitpack_d *,
 				  struct cl_target_option *);
diff --git a/gcc/lto/lto-partition.cc b/gcc/lto/lto-partition.cc
index 19f91e5d660..0985631dee0 100644
--- a/gcc/lto/lto-partition.cc
+++ b/gcc/lto/lto-partition.cc
@@ -593,8 +593,7 @@ lto_balanced_map (int n_lto_partitions, int max_partition_size)
 
 	      last_visited_node++;
 
-	      gcc_assert (node->definition || node->weakref
-			  || node->declare_variant_alt);
+	      gcc_assert (node->definition || node->weakref);
 
 	      /* Compute boundary cost of callgraph edges.  */
 	      for (edge = node->callees; edge; edge = edge->next_callee)
@@ -705,7 +704,7 @@ lto_balanced_map (int n_lto_partitions, int max_partition_size)
 		int index;
 
 		node = dyn_cast <cgraph_node *> (ref->referring);
-		gcc_assert (node->definition || node->declare_variant_alt);
+		gcc_assert (node->definition);
 		index = lto_symtab_encoder_lookup (partition->encoder,
 						   node);
 		if (index != LCC_NOT_FOUND
diff --git a/gcc/omp-expand.cc b/gcc/omp-expand.cc
index f44ba204123..5abd2240711 100644
--- a/gcc/omp-expand.cc
+++ b/gcc/omp-expand.cc
@@ -10109,7 +10109,7 @@ expand_omp_target (struct omp_region *region)
 
 	  /* Enable pass_omp_device_lower pass.  */
 	  fn2_node = cgraph_node::get (DECL_CONTEXT (child_fn));
-	  fn2_node->calls_declare_variant_alt = 1;
+	  fn2_node->has_metadirectives = 1;
 
 	  t = build_decl (DECL_SOURCE_LOCATION (child_fn),
 			  RESULT_DECL, NULL_TREE, void_type_node);
diff --git a/gcc/omp-general.cc b/gcc/omp-general.cc
index 13cf43d272f..b7eca439ad9 100644
--- a/gcc/omp-general.cc
+++ b/gcc/omp-general.cc
@@ -2617,222 +2617,6 @@ omp_complete_construct_context (tree construct_context, bool *completep)
   return construct_context;
 }
 
-/* Class describing a single variant.  */
-struct GTY(()) omp_declare_variant_entry {
-  /* NODE of the variant.  */
-  cgraph_node *variant;
-  /* Score if not in declare simd clone.  */
-  score_wide_int score;
-  /* Score if in declare simd clone.  */
-  score_wide_int score_in_declare_simd_clone;
-  /* Context selector for the variant.  */
-  tree ctx;
-  /* True if the context selector is known to match already.  */
-  bool matches;
-};
-
-/* Class describing a function with variants.  */
-struct GTY((for_user)) omp_declare_variant_base_entry {
-  /* NODE of the base function.  */
-  cgraph_node *base;
-  /* NODE of the artificial function created for the deferred variant
-     resolution.  */
-  cgraph_node *node;
-  /* Vector of the variants.  */
-  vec<omp_declare_variant_entry, va_gc> *variants;
-};
-
-struct omp_declare_variant_hasher
-  : ggc_ptr_hash<omp_declare_variant_base_entry> {
-  static hashval_t hash (omp_declare_variant_base_entry *);
-  static bool equal (omp_declare_variant_base_entry *,
-		     omp_declare_variant_base_entry *);
-};
-
-hashval_t
-omp_declare_variant_hasher::hash (omp_declare_variant_base_entry *x)
-{
-  inchash::hash hstate;
-  hstate.add_int (DECL_UID (x->base->decl));
-  hstate.add_int (x->variants->length ());
-  omp_declare_variant_entry *variant;
-  unsigned int i;
-  FOR_EACH_VEC_SAFE_ELT (x->variants, i, variant)
-    {
-      hstate.add_int (DECL_UID (variant->variant->decl));
-      hstate.add_wide_int (variant->score);
-      hstate.add_wide_int (variant->score_in_declare_simd_clone);
-      hstate.add_ptr (variant->ctx);
-      hstate.add_int (variant->matches);
-    }
-  return hstate.end ();
-}
-
-bool
-omp_declare_variant_hasher::equal (omp_declare_variant_base_entry *x,
-				   omp_declare_variant_base_entry *y)
-{
-  if (x->base != y->base
-      || x->variants->length () != y->variants->length ())
-    return false;
-  omp_declare_variant_entry *variant;
-  unsigned int i;
-  FOR_EACH_VEC_SAFE_ELT (x->variants, i, variant)
-    if (variant->variant != (*y->variants)[i].variant
-	|| variant->score != (*y->variants)[i].score
-	|| (variant->score_in_declare_simd_clone
-	    != (*y->variants)[i].score_in_declare_simd_clone)
-	|| variant->ctx != (*y->variants)[i].ctx
-	|| variant->matches != (*y->variants)[i].matches)
-      return false;
-  return true;
-}
-
-static GTY(()) hash_table<omp_declare_variant_hasher> *omp_declare_variants;
-
-struct omp_declare_variant_alt_hasher
-  : ggc_ptr_hash<omp_declare_variant_base_entry> {
-  static hashval_t hash (omp_declare_variant_base_entry *);
-  static bool equal (omp_declare_variant_base_entry *,
-		     omp_declare_variant_base_entry *);
-};
-
-hashval_t
-omp_declare_variant_alt_hasher::hash (omp_declare_variant_base_entry *x)
-{
-  return DECL_UID (x->node->decl);
-}
-
-bool
-omp_declare_variant_alt_hasher::equal (omp_declare_variant_base_entry *x,
-				       omp_declare_variant_base_entry *y)
-{
-  return x->node == y->node;
-}
-
-static GTY(()) hash_table<omp_declare_variant_alt_hasher>
-  *omp_declare_variant_alt;
-
-void
-omp_lto_output_declare_variant_alt (lto_simple_output_block *ob,
-				    cgraph_node *node,
-				    lto_symtab_encoder_t encoder)
-{
-  gcc_assert (node->declare_variant_alt);
-
-  omp_declare_variant_base_entry entry;
-  entry.base = NULL;
-  entry.node = node;
-  entry.variants = NULL;
-  omp_declare_variant_base_entry *entryp
-    = omp_declare_variant_alt->find_with_hash (&entry, DECL_UID (node->decl));
-  gcc_assert (entryp);
-
-  int nbase = lto_symtab_encoder_lookup (encoder, entryp->base);
-  gcc_assert (nbase != LCC_NOT_FOUND);
-  streamer_write_hwi_stream (ob->main_stream, nbase);
-
-  streamer_write_hwi_stream (ob->main_stream, entryp->variants->length ());
-
-  unsigned int i;
-  omp_declare_variant_entry *varentry;
-  FOR_EACH_VEC_SAFE_ELT (entryp->variants, i, varentry)
-    {
-      int nvar = lto_symtab_encoder_lookup (encoder, varentry->variant);
-      gcc_assert (nvar != LCC_NOT_FOUND);
-      streamer_write_hwi_stream (ob->main_stream, nvar);
-
-      for (score_wide_int *w = &varentry->score; ;
-	   w = &varentry->score_in_declare_simd_clone)
-	{
-	  unsigned len = w->get_len ();
-	  streamer_write_hwi_stream (ob->main_stream, len);
-	  const HOST_WIDE_INT *val = w->get_val ();
-	  for (unsigned j = 0; j < len; j++)
-	    streamer_write_hwi_stream (ob->main_stream, val[j]);
-	  if (w == &varentry->score_in_declare_simd_clone)
-	    break;
-	}
-
-      HOST_WIDE_INT cnt = -1;
-      HOST_WIDE_INT i = varentry->matches ? 1 : 0;
-      for (tree attr = DECL_ATTRIBUTES (entryp->base->decl);
-	   attr; attr = TREE_CHAIN (attr), i += 2)
-	{
-	  attr = lookup_attribute ("omp declare variant base", attr);
-	  if (attr == NULL_TREE)
-	    break;
-
-	  if (varentry->ctx == TREE_VALUE (TREE_VALUE (attr)))
-	    {
-	      cnt = i;
-	      break;
-	    }
-	}
-
-      gcc_assert (cnt != -1);
-      streamer_write_hwi_stream (ob->main_stream, cnt);
-    }
-}
-
-void
-omp_lto_input_declare_variant_alt (lto_input_block *ib, cgraph_node *node,
-				   vec<symtab_node *> nodes)
-{
-  gcc_assert (node->declare_variant_alt);
-  omp_declare_variant_base_entry *entryp
-    = ggc_cleared_alloc<omp_declare_variant_base_entry> ();
-  entryp->base = dyn_cast<cgraph_node *> (nodes[streamer_read_hwi (ib)]);
-  entryp->node = node;
-  unsigned int len = streamer_read_hwi (ib);
-  vec_alloc (entryp->variants, len);
-
-  for (unsigned int i = 0; i < len; i++)
-    {
-      omp_declare_variant_entry varentry;
-      varentry.variant
-	= dyn_cast<cgraph_node *> (nodes[streamer_read_hwi (ib)]);
-      for (score_wide_int *w = &varentry.score; ;
-	   w = &varentry.score_in_declare_simd_clone)
-	{
-	  unsigned len2 = streamer_read_hwi (ib);
-	  HOST_WIDE_INT arr[WIDE_INT_MAX_HWIS (1024)];
-	  gcc_assert (len2 <= WIDE_INT_MAX_HWIS (1024));
-	  for (unsigned int j = 0; j < len2; j++)
-	    arr[j] = streamer_read_hwi (ib);
-	  *w = score_wide_int::from_array (arr, len2, true);
-	  if (w == &varentry.score_in_declare_simd_clone)
-	    break;
-	}
-
-      HOST_WIDE_INT cnt = streamer_read_hwi (ib);
-      HOST_WIDE_INT j = 0;
-      varentry.ctx = NULL_TREE;
-      varentry.matches = (cnt & 1) ? true : false;
-      cnt &= ~HOST_WIDE_INT_1;
-      for (tree attr = DECL_ATTRIBUTES (entryp->base->decl);
-	   attr; attr = TREE_CHAIN (attr), j += 2)
-	{
-	  attr = lookup_attribute ("omp declare variant base", attr);
-	  if (attr == NULL_TREE)
-	    break;
-
-	  if (cnt == j)
-	    {
-	      varentry.ctx = TREE_VALUE (TREE_VALUE (attr));
-	      break;
-	    }
-	}
-      gcc_assert (varentry.ctx != NULL_TREE);
-      entryp->variants->quick_push (varentry);
-    }
-  if (omp_declare_variant_alt == NULL)
-    omp_declare_variant_alt
-      = hash_table<omp_declare_variant_alt_hasher>::create_ggc (64);
-  *omp_declare_variant_alt->find_slot_with_hash (entryp, DECL_UID (node->decl),
-						 INSERT) = entryp;
-}
-
 /* Comparison function for sorting routines, to sort OpenMP metadirective
    variants by decreasing score.  */
 
@@ -4138,5 +3922,3 @@ debug_omp_tokenized_addr (vec<omp_addr_token *> &addr_tokens,
   fputs ("\n", stderr);
 }
 
-
-#include "gt-omp-general.h"
diff --git a/gcc/omp-offload.cc b/gcc/omp-offload.cc
index c093440bc09..613b77571e6 100644
--- a/gcc/omp-offload.cc
+++ b/gcc/omp-offload.cc
@@ -2718,8 +2718,6 @@ execute_omp_device_lower ()
   bool regimplify = false;
   basic_block bb;
   gimple_stmt_iterator gsi;
-  bool calls_declare_variant_alt
-    = cgraph_node::get (cfun->decl)->calls_declare_variant_alt;
   auto_vec<basic_block> metadirective_bbs;
 #ifdef ACCEL_COMPILER
   bool omp_redirect_indirect_calls = vec_safe_length (offload_ind_funcs) > 0;
@@ -2736,8 +2734,6 @@ execute_omp_device_lower ()
 	  continue;
 	if (!gimple_call_internal_p (stmt))
 	  {
-	    /* FIXME: this is a leftover of obsolete code.  */
-	    gcc_assert (!calls_declare_variant_alt);
 #ifdef ACCEL_COMPILER
 	    if (omp_redirect_indirect_calls
 		&& gimple_call_fndecl (stmt) == NULL_TREE)
@@ -2919,9 +2915,7 @@ public:
 #endif
       return (!(fun->curr_properties & PROP_gimple_lomp_dev)
 	      || (flag_openmp
-		  && (node->calls_declare_variant_alt
-		      || node->has_metadirectives
-		      || offload_ind_funcs_p)));
+		  && (node->has_metadirectives || offload_ind_funcs_p)));
     }
   unsigned int execute (function *) final override
     {
diff --git a/gcc/omp-simd-clone.cc b/gcc/omp-simd-clone.cc
index fa80b6b3bb9..52806620ed0 100644
--- a/gcc/omp-simd-clone.cc
+++ b/gcc/omp-simd-clone.cc
@@ -688,8 +688,6 @@ simd_clone_create (struct cgraph_node *old_node, bool force_local)
 	 the old node.  */
       new_node->local = old_node->local;
       new_node->externally_visible = old_node->externally_visible;
-      new_node->calls_declare_variant_alt
-	= old_node->calls_declare_variant_alt;
       new_node->has_metadirectives = old_node->has_metadirectives;
     }
 
diff --git a/gcc/passes.cc b/gcc/passes.cc
index d73f8ba97b6..e9d18b9d22e 100644
--- a/gcc/passes.cc
+++ b/gcc/passes.cc
@@ -2881,8 +2881,7 @@ ipa_write_summaries (void)
     {
       struct cgraph_node *node = order[i];
 
-      if ((node->definition || node->declare_variant_alt)
-	  && node->need_lto_streaming)
+      if (node->definition && node->need_lto_streaming)
 	{
 	  if (gimple_has_body_p (node->decl))
 	    lto_prepare_function_for_streaming (node);
diff --git a/gcc/symtab.cc b/gcc/symtab.cc
index 3b018ab3ea2..5660857fa51 100644
--- a/gcc/symtab.cc
+++ b/gcc/symtab.cc
@@ -2160,7 +2160,7 @@ symtab_node::get_partitioning_class (void)
   if (DECL_ABSTRACT_P (decl))
     return SYMBOL_EXTERNAL;
 
-  if (cnode && (cnode->inlined_to || cnode->declare_variant_alt))
+  if (cnode && cnode->inlined_to)
     return SYMBOL_DUPLICATE;
 
   /* Transparent aliases are always duplicated.  */
diff --git a/gcc/tree-inline.cc b/gcc/tree-inline.cc
index 0a3ad616d84..8674baec5f2 100644
--- a/gcc/tree-inline.cc
+++ b/gcc/tree-inline.cc
@@ -5058,8 +5058,6 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id,
   if (src_properties != prop_mask)
     dst_cfun->curr_properties &= src_properties | ~prop_mask;
   dst_cfun->calls_eh_return |= id->src_cfun->calls_eh_return;
-  id->dst_node->calls_declare_variant_alt
-    |= id->src_node->calls_declare_variant_alt;
   id->dst_node->has_metadirectives |= id->src_node->has_metadirectives;
 
   gcc_assert (!id->src_cfun->after_inlining);
@@ -6314,8 +6312,6 @@ tree_function_versioning (tree old_decl, tree new_decl,
   DECL_ARGUMENTS (new_decl) = DECL_ARGUMENTS (old_decl);
   initialize_cfun (new_decl, old_decl,
 		   new_entry ? new_entry->count : old_entry_block->count);
-  new_version_node->calls_declare_variant_alt
-    = old_version_node->calls_declare_variant_alt;
   new_version_node->has_metadirectives = old_version_node->has_metadirectives;
   if (DECL_STRUCT_FUNCTION (new_decl)->gimple_df)
     DECL_STRUCT_FUNCTION (new_decl)->gimple_df->ipa_pta
-- 
2.25.1


  parent reply	other threads:[~2024-05-04 21:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-04 21:21 [PATCH 00/12] OpenMP: Metadirective support + "declare variant" improvements Sandra Loosemore
2024-05-04 21:21 ` [PATCH 01/12] OpenMP: metadirective tree data structures and front-end interfaces Sandra Loosemore
2024-05-04 21:21 ` [PATCH 02/12] OpenMP: middle-end support for metadirectives Sandra Loosemore
2024-05-04 21:21 ` [PATCH 03/12] libgomp: runtime support for target_device selector Sandra Loosemore
2024-05-04 21:21 ` [PATCH 04/12] OpenMP: C front end support for metadirectives Sandra Loosemore
2024-05-04 21:21 ` [PATCH 05/12] OpenMP: C++ front-end " Sandra Loosemore
2024-05-04 21:21 ` [PATCH 06/12] OpenMP: common c/c++ testcases " Sandra Loosemore
2024-05-04 21:21 ` [PATCH 07/12] OpenMP: Fortran front-end support " Sandra Loosemore
2024-05-04 21:21 ` [PATCH 08/12] OpenMP: Reject other properties with kind(any) Sandra Loosemore
2024-05-04 21:21 ` [PATCH 09/12] OpenMP: Extend dynamic selector support to declare variant Sandra Loosemore
2024-05-04 21:21 ` Sandra Loosemore [this message]
2024-05-04 21:21 ` [PATCH 11/12] OpenMP: Update "declare target"/OpenMP context interaction Sandra Loosemore
2024-05-04 21:21 ` [PATCH 12/12] OpenMP: Update documentation of metadirective implementation status Sandra Loosemore

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=20240504212153.3561429-11-sloosemore@baylibre.com \
    --to=sloosemore@baylibre.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=tburnus@baylibre.com \
    /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).