public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Remove dead code.
@ 2021-11-08  8:45 Martin Liška
  2021-11-08  8:59 ` Jakub Jelinek
  0 siblings, 1 reply; 32+ messages in thread
From: Martin Liška @ 2021-11-08  8:45 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jakub Jelinek, Tobias Burnus

This fixes issue reported in the PR.

Ready to be installed?
Thanks,
Martin

	PR other/89259

liboffloadmic/ChangeLog:

	* runtime/offload_omp_host.cpp: Remove size < 0 for a size of
	size_t type.
---
  liboffloadmic/runtime/offload_omp_host.cpp | 5 -----
  1 file changed, 5 deletions(-)

diff --git a/liboffloadmic/runtime/offload_omp_host.cpp b/liboffloadmic/runtime/offload_omp_host.cpp
index 0439fec313b..4d8c57e3385 100644
--- a/liboffloadmic/runtime/offload_omp_host.cpp
+++ b/liboffloadmic/runtime/offload_omp_host.cpp
@@ -688,11 +688,6 @@ int omp_target_associate_ptr(
          return 1;
      }
  
-    // An incorrect size is treated as failure
-    if (size < 0) {
-        return 1;
-    }
-
      // If OpenMP allows wrap-around for device numbers, enable next line
      //Engine& device = mic_engines[device_num % mic_engines_total];
      Engine& device = mic_engines[device_num];
-- 
2.33.1


^ permalink raw reply	[flat|nested] 32+ messages in thread
* [PATCH] Remove dead code
@ 2020-06-09 16:24 Richard Biener
  0 siblings, 0 replies; 32+ messages in thread
From: Richard Biener @ 2020-06-09 16:24 UTC (permalink / raw)
  To: gcc-patches

This removes dead code left over from the reduction vectorization
refactoring last year.

Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.

Richard.

2020-06-09  Richard Biener  <rguenther@suse.de>

	* tree-vect-loop.c (vectorizable_induction): Remove dead code.
---
 gcc/tree-vect-loop.c | 42 ------------------------------------------
 1 file changed, 42 deletions(-)

diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index f2c52ae1909..5329982e4c9 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -7373,11 +7373,6 @@ vectorizable_induction (loop_vec_info loop_vinfo,
   unsigned i;
   tree expr;
   gimple_seq stmts;
-  imm_use_iterator imm_iter;
-  use_operand_p use_p;
-  gimple *exit_phi;
-  edge latch_e;
-  tree loop_arg;
   gimple_stmt_iterator si;
 
   gphi *phi = dyn_cast <gphi *> (stmt_info->stmt);
@@ -7485,9 +7480,6 @@ vectorizable_induction (loop_vec_info loop_vinfo,
   if (dump_enabled_p ())
     dump_printf_loc (MSG_NOTE, vect_location, "transform induction phi.\n");
 
-  latch_e = loop_latch_edge (iv_loop);
-  loop_arg = PHI_ARG_DEF_FROM_EDGE (phi, latch_e);
-
   step_expr = STMT_VINFO_LOOP_PHI_EVOLUTION_PART (stmt_info);
   gcc_assert (step_expr != NULL_TREE);
   tree step_vectype = get_same_sized_vectype (TREE_TYPE (step_expr), vectype);
@@ -7872,40 +7864,6 @@ vectorizable_induction (loop_vec_info loop_vinfo,
 	}
     }
 
-  if (nested_in_vect_loop)
-    {
-      /* Find the loop-closed exit-phi of the induction, and record
-         the final vector of induction results:  */
-      exit_phi = NULL;
-      FOR_EACH_IMM_USE_FAST (use_p, imm_iter, loop_arg)
-        {
-	  gimple *use_stmt = USE_STMT (use_p);
-	  if (is_gimple_debug (use_stmt))
-	    continue;
-
-	  if (!flow_bb_inside_loop_p (iv_loop, gimple_bb (use_stmt)))
-	    {
-	      exit_phi = use_stmt;
-	      break;
-	    }
-        }
-      if (exit_phi)
-	{
-	  stmt_vec_info stmt_vinfo = loop_vinfo->lookup_stmt (exit_phi);
-	  /* FORNOW. Currently not supporting the case that an inner-loop induction
-	     is not used in the outer-loop (i.e. only outside the outer-loop).  */
-	  gcc_assert (STMT_VINFO_RELEVANT_P (stmt_vinfo)
-		      && !STMT_VINFO_LIVE_P (stmt_vinfo));
-
-	  STMT_VINFO_VEC_STMT (stmt_vinfo) = new_stmt_info;
-	  if (dump_enabled_p ())
-	    dump_printf_loc (MSG_NOTE, vect_location,
-			     "vector of inductions after inner-loop:%G",
-			     new_stmt);
-	}
-    }
-
-
   if (dump_enabled_p ())
     dump_printf_loc (MSG_NOTE, vect_location,
 		     "transform induction: created def-use cycle: %G%G",
-- 
2.25.1

^ permalink raw reply	[flat|nested] 32+ messages in thread
* [PATCH] Remove dead code
@ 2020-06-09 14:01 Richard Biener
  0 siblings, 0 replies; 32+ messages in thread
From: Richard Biener @ 2020-06-09 14:01 UTC (permalink / raw)
  To: gcc-patches

This removes dead code that was left over from the reduction
vectorization refactoring last year.

Bootstrapped / tested on x86_64-unknown-linux-gnu, applied.

Richard.

2020-06-09  Richard Biener  <rguenther@suse.de>

	* tree-vect-stmts.c (vect_transform_stmt): Remove dead code.
---
 gcc/tree-vect-stmts.c | 43 -------------------------------------------
 1 file changed, 43 deletions(-)

diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index b24b0fe4304..61adf7d7fa4 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -11186,12 +11186,6 @@ vect_transform_stmt (vec_info *vinfo,
   gcc_assert (slp_node || !PURE_SLP_STMT (stmt_info));
   stmt_vec_info old_vec_stmt_info = STMT_VINFO_VEC_STMT (stmt_info);
 
-  loop_vec_info loop_vinfo = dyn_cast <loop_vec_info> (vinfo);
-  bool nested_p = (loop_vinfo
-		   && nested_in_vect_loop_p
-			(LOOP_VINFO_LOOP (loop_vinfo), stmt_info));
-
-  gimple *stmt = stmt_info->stmt;
   switch (STMT_VINFO_TYPE (stmt_info))
     {
     case type_demotion_vec_info_type:
@@ -11266,13 +11260,11 @@ vect_transform_stmt (vec_info *vinfo,
     case call_vec_info_type:
       done = vectorizable_call (vinfo, stmt_info,
 				gsi, &vec_stmt, slp_node, NULL);
-      stmt = gsi_stmt (*gsi);
       break;
 
     case call_simd_clone_vec_info_type:
       done = vectorizable_simd_clone_call (vinfo, stmt_info, gsi, &vec_stmt,
 					   slp_node, NULL);
-      stmt = gsi_stmt (*gsi);
       break;
 
     case reduc_vec_info_type:
@@ -11310,41 +11302,6 @@ vect_transform_stmt (vec_info *vinfo,
     gcc_assert (!vec_stmt
 		&& STMT_VINFO_VEC_STMT (stmt_info) == old_vec_stmt_info);
 
-  /* Handle inner-loop stmts whose DEF is used in the loop-nest that
-     is being vectorized, but outside the immediately enclosing loop.  */
-  if (vec_stmt
-      && nested_p
-      && STMT_VINFO_TYPE (stmt_info) != reduc_vec_info_type
-      && (STMT_VINFO_RELEVANT (stmt_info) == vect_used_in_outer
-          || STMT_VINFO_RELEVANT (stmt_info) ==
-                                           vect_used_in_outer_by_reduction))
-    {
-      class loop *innerloop = LOOP_VINFO_LOOP (loop_vinfo)->inner;
-      imm_use_iterator imm_iter;
-      use_operand_p use_p;
-      tree scalar_dest;
-
-      if (dump_enabled_p ())
-        dump_printf_loc (MSG_NOTE, vect_location,
-                         "Record the vdef for outer-loop vectorization.\n");
-
-      /* Find the relevant loop-exit phi-node, and reord the vec_stmt there
-        (to be used when vectorizing outer-loop stmts that use the DEF of
-        STMT).  */
-      if (gimple_code (stmt) == GIMPLE_PHI)
-        scalar_dest = PHI_RESULT (stmt);
-      else
-        scalar_dest = gimple_get_lhs (stmt);
-
-      FOR_EACH_IMM_USE_FAST (use_p, imm_iter, scalar_dest)
-	if (!flow_bb_inside_loop_p (innerloop, gimple_bb (USE_STMT (use_p))))
-	  {
-	    stmt_vec_info exit_phi_info
-	      = vinfo->lookup_stmt (USE_STMT (use_p));
-	    STMT_VINFO_VEC_STMT (exit_phi_info) = vec_stmt;
-	  }
-    }
-
   if (vec_stmt)
     STMT_VINFO_VEC_STMT (stmt_info) = vec_stmt;
 
-- 
2.25.1

^ permalink raw reply	[flat|nested] 32+ messages in thread
* [PATCH] Remove dead code
@ 2019-09-18 12:42 Richard Biener
  0 siblings, 0 replies; 32+ messages in thread
From: Richard Biener @ 2019-09-18 12:42 UTC (permalink / raw)
  To: gcc-patches


This removes dead code from the vectorizer and makes a function static.

Bootstrapped / tested on x86_64-unknown-linux-gnu, applied.

Richard.

2019-09-18  Richard Biener  <rguenther@suse.de>

	* tree-vectorizer.h (get_initial_def_for_reduction): Remove.
	* tree-vect-loop.c (get_initial_def_for_reduction): Make
	static.
	(vect_create_epilog_for_reduction): Remove dead code.

Index: gcc/tree-vect-loop.c
===================================================================
--- gcc/tree-vect-loop.c	(revision 275873)
+++ gcc/tree-vect-loop.c	(working copy)
@@ -4203,7 +4203,7 @@ vect_model_induction_cost (stmt_vec_info
 
    A cost model should help decide between these two schemes.  */
 
-tree
+static tree
 get_initial_def_for_reduction (stmt_vec_info stmt_vinfo, tree init_val,
                                tree *adjustment_def)
 {
@@ -4585,7 +4585,6 @@ vect_create_epilog_for_reduction (vec<tr
      (in case of SLP, do it for all the phis). */
 
   /* Get the loop-entry arguments.  */
-  enum vect_def_type initial_def_dt = vect_unknown_def_type;
   if (slp_node)
     {
       unsigned vec_num = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
@@ -4623,7 +4622,6 @@ vect_create_epilog_for_reduction (vec<tr
 	{
 	  /* Do not use an adjustment def as that case is not supported
 	     correctly if ncopies is not one.  */
-	  vect_is_simple_use (initial_def, loop_vinfo, &initial_def_dt);
 	  vec_initial_def = vect_get_vec_def_for_operand (initial_def,
 							  stmt_info);
 	}
Index: gcc/tree-vectorizer.h
===================================================================
--- gcc/tree-vectorizer.h	(revision 275873)
+++ gcc/tree-vectorizer.h	(working copy)
@@ -1645,7 +1645,6 @@ extern bool vectorizable_reduction (stmt
 extern bool vectorizable_induction (stmt_vec_info, gimple_stmt_iterator *,
 				    stmt_vec_info *, slp_tree,
 				    stmt_vector_for_cost *);
-extern tree get_initial_def_for_reduction (stmt_vec_info, tree, tree *);
 extern bool vect_worthwhile_without_simd_p (vec_info *, tree_code);
 extern int vect_get_known_peeling_cost (loop_vec_info, int, int *,
 					stmt_vector_for_cost *,

^ permalink raw reply	[flat|nested] 32+ messages in thread
* [PATCH] Remove dead code
@ 2019-09-03 10:27 Richard Biener
  0 siblings, 0 replies; 32+ messages in thread
From: Richard Biener @ 2019-09-03 10:27 UTC (permalink / raw)
  To: gcc-patches


I am testing the following.

Richard.

2019-09-03  Richard Biener  <rguenther@suse.de>

	* tree-ssa-sccvn.h (vn_nary_op_lookup): Remove.
	(vn_nary_op_insert): Likewise.
	* tree-ssa-sccvn.c (init_vn_nary_op_from_op): Remove.
	(vn_nary_op_lookup): Likewise.
	(vn_nary_op_insert): Likewise.

Index: gcc/tree-ssa-sccvn.c
===================================================================
--- gcc/tree-ssa-sccvn.c	(revision 275294)
+++ gcc/tree-ssa-sccvn.c	(working copy)
@@ -3325,20 +3408,6 @@ init_vn_nary_op_from_pieces (vn_nary_op_
   memcpy (&vno->op[0], ops, sizeof (tree) * length);
 }
 
-/* Initialize VNO from OP.  */
-
-static void
-init_vn_nary_op_from_op (vn_nary_op_t vno, tree op)
-{
-  unsigned i;
-
-  vno->opcode = TREE_CODE (op);
-  vno->length = TREE_CODE_LENGTH (TREE_CODE (op));
-  vno->type = TREE_TYPE (op);
-  for (i = 0; i < vno->length; ++i)
-    vno->op[i] = TREE_OPERAND (op, i);
-}
-
 /* Return the number of operands for a vn_nary ops structure from STMT.  */
 
 static unsigned int
@@ -3440,22 +3509,6 @@ vn_nary_op_lookup_pieces (unsigned int l
   return vn_nary_op_lookup_1 (vno1, vnresult);
 }
 
-/* Lookup OP in the current hash table, and return the resulting value
-   number if it exists in the hash table.  Return NULL_TREE if it does
-   not exist in the hash table or if the result field of the operation
-   is NULL. VNRESULT will contain the vn_nary_op_t from the hashtable
-   if it exists.  */
-
-tree
-vn_nary_op_lookup (tree op, vn_nary_op_t *vnresult)
-{
-  vn_nary_op_t vno1
-    = XALLOCAVAR (struct vn_nary_op_s,
-		  sizeof_vn_nary_op (TREE_CODE_LENGTH (TREE_CODE (op))));
-  init_vn_nary_op_from_op (vno1, op);
-  return vn_nary_op_lookup_1 (vno1, vnresult);
-}
-
 /* Lookup the rhs of STMT in the current hash table, and return the resulting
    value number if it exists in the hash table.  Return NULL_TREE if
    it does not exist in the hash table.  VNRESULT will contain the
@@ -3708,21 +3761,6 @@ vn_nary_op_get_predicated_value (vn_nary
   return NULL_TREE;
 }
 
-/* Insert OP into the current hash table with a value number of
-   RESULT.  Return the vn_nary_op_t structure we created and put in
-   the hashtable.  */
-
-vn_nary_op_t
-vn_nary_op_insert (tree op, tree result)
-{
-  unsigned length = TREE_CODE_LENGTH (TREE_CODE (op));
-  vn_nary_op_t vno1;
-
-  vno1 = alloc_vn_nary_op (length, result, VN_INFO (result)->value_id);
-  init_vn_nary_op_from_op (vno1, op);
-  return vn_nary_op_insert_into (vno1, valid_info->nary, true);
-}
-
 /* Insert the rhs of STMT into the current hash table with a value number of
    RESULT.  */
 
Index: gcc/tree-ssa-sccvn.h
===================================================================
--- gcc/tree-ssa-sccvn.h	(revision 275294)
+++ gcc/tree-ssa-sccvn.h	(working copy)
@@ -244,11 +244,9 @@ bool has_VN_INFO (tree);
 extern vn_ssa_aux_t VN_INFO (tree);
 tree vn_get_expr_for (tree);
 void scc_vn_restore_ssa_info (void);
-tree vn_nary_op_lookup (tree, vn_nary_op_t *);
 tree vn_nary_op_lookup_stmt (gimple *, vn_nary_op_t *);
 tree vn_nary_op_lookup_pieces (unsigned int, enum tree_code,
 			       tree, tree *, vn_nary_op_t *);
-vn_nary_op_t vn_nary_op_insert (tree, tree);
 vn_nary_op_t vn_nary_op_insert_pieces (unsigned int, enum tree_code,
 				       tree, tree *, tree, unsigned int);
 bool ao_ref_init_from_vn_reference (ao_ref *, alias_set_type, tree,

^ permalink raw reply	[flat|nested] 32+ messages in thread
* [PATCH] Remove dead code.
@ 2015-05-04 11:50 Dominik Vogt
  2015-05-04 17:13 ` Jeff Law
  0 siblings, 1 reply; 32+ messages in thread
From: Dominik Vogt @ 2015-05-04 11:50 UTC (permalink / raw)
  To: gcc-patches; +Cc: Andreas Krebbel

[-- Attachment #1: Type: text/plain, Size: 241 bytes --]

This patch removes a "write only" variable from the C++ code.

ChangeLog:

--

2015-05-04  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	* call.c (print_z_candidates): Remove dead code.

--

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany

[-- Attachment #2: 0001-Remove-dead-code.patch --]
[-- Type: text/x-diff, Size: 896 bytes --]

From 6943ad84a5a5b69c7cf5df1ea5bb6ab5fd254825 Mon Sep 17 00:00:00 2001
From: Dominik Vogt <vogt@linux.vnet.ibm.com>
Date: Mon, 4 May 2015 12:46:21 +0100
Subject: [PATCH] Remove dead code.

---
 gcc/cp/call.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 31d2b9c..55350f8 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -3436,7 +3436,6 @@ print_z_candidates (location_t loc, struct z_candidate *candidates)
 {
   struct z_candidate *cand1;
   struct z_candidate **cand2;
-  int n_candidates;
 
   if (!candidates)
     return;
@@ -3478,9 +3477,6 @@ print_z_candidates (location_t loc, struct z_candidate *candidates)
 	}
     }
 
-  for (n_candidates = 0, cand1 = candidates; cand1; cand1 = cand1->next)
-    n_candidates++;
-
   for (; candidates; candidates = candidates->next)
     print_z_candidate (loc, "candidate:", candidates);
 }
-- 
2.3.0


^ permalink raw reply	[flat|nested] 32+ messages in thread
* [PATCH] Remove dead code
@ 2013-01-16 14:51 Richard Biener
  0 siblings, 0 replies; 32+ messages in thread
From: Richard Biener @ 2013-01-16 14:51 UTC (permalink / raw)
  To: gcc-patches


Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2013-01-16  Richard Biener  <rguenther@suse.de>

	* tree-inline.c (tree_function_versioning): Remove set but
	never used variable.

Index: gcc/tree-inline.c
===================================================================
--- gcc/tree-inline.c	(revision 195232)
+++ gcc/tree-inline.c	(working copy)
@@ -5190,7 +5190,6 @@ tree_function_versioning (tree old_decl,
 	replace_info = (*tree_map)[i];
 	if (replace_info->replace_p)
 	  {
-	    tree op = replace_info->new_tree;
 	    if (!replace_info->old_tree)
 	      {
 		int i = replace_info->parm_num;
@@ -5199,13 +5198,6 @@ tree_function_versioning (tree old_decl,
 		  i --;
 		replace_info->old_tree = parm;
 	      }
-		
-
-	    STRIP_NOPS (op);
-
-	    if (TREE_CODE (op) == VIEW_CONVERT_EXPR)
-	      op = TREE_OPERAND (op, 0);
-
 	    gcc_assert (TREE_CODE (replace_info->old_tree) == PARM_DECL);
 	    init = setup_one_parameter (&id, replace_info->old_tree,
 	    			        replace_info->new_tree, id.src_fn,

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

end of thread, other threads:[~2023-02-08  7:47 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08  8:45 [PATCH] Remove dead code Martin Liška
2021-11-08  8:59 ` Jakub Jelinek
2021-11-08 14:19   ` Jeff Law
2021-11-12 14:27     ` Martin Liška
2021-11-12 14:41       ` H.J. Lu
2021-11-12 14:44         ` Martin Liška
2021-11-12 15:00           ` H.J. Lu
2021-11-12 19:14         ` Richard Biener
2021-11-12 19:18           ` H.J. Lu
2021-11-12 19:52             ` Richard Biener
2022-10-20 11:15         ` Remove support for Intel MIC offloading (was: [PATCH] Remove dead code.) Thomas Schwinge
2022-10-20 11:34           ` Jakub Jelinek
2022-11-04 10:05             ` GCC 13: OpenMP offloading to Intel MIC has been removed (was: Remove support for Intel MIC offloading) Thomas Schwinge
2022-11-04 10:36               ` Jakub Jelinek
2022-10-20 12:33           ` Remove support for Intel MIC offloading (was: [PATCH] Remove dead code.) Michael Matz
2022-10-20 12:40             ` Jakub Jelinek
2022-10-20 13:09               ` Richard Biener
2023-02-01 15:12                 ` Martin Jambor
2023-02-02 21:13                   ` GSoC project idea: Separate Host Process Offloading (was: Remove support for Intel MIC offloading) Thomas Schwinge
2023-02-07 23:26                     ` GSoC project idea: Separate Host Process Offloading Thomas Schwinge
2023-02-08  7:47                       ` Tobias Burnus
2022-10-20 20:56           ` Remove support for Intel MIC offloading Thomas Schwinge
2022-11-04  9:54             ` Thomas Schwinge
2022-11-04 10:30               ` Jakub Jelinek
2022-11-04 10:35                 ` Thomas Schwinge
  -- strict thread matches above, loose matches on Subject: below --
2020-06-09 16:24 [PATCH] Remove dead code Richard Biener
2020-06-09 14:01 Richard Biener
2019-09-18 12:42 Richard Biener
2019-09-03 10:27 Richard Biener
2015-05-04 11:50 Dominik Vogt
2015-05-04 17:13 ` Jeff Law
2013-01-16 14:51 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).