public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Remove dead code
@ 2020-06-09 16:24 Richard Biener
  0 siblings, 0 replies; 17+ 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] 17+ messages in thread

* Re: [PATCH] Remove dead code.
  2021-11-12 19:18           ` H.J. Lu
@ 2021-11-12 19:52             ` Richard Biener
  0 siblings, 0 replies; 17+ messages in thread
From: Richard Biener @ 2021-11-12 19:52 UTC (permalink / raw)
  To: H.J. Lu
  Cc: H.J. Lu via Gcc-patches, Martin Liška, Hongtao Liu,
	Jakub Jelinek, Tobias Burnus

On November 12, 2021 8:18:59 PM GMT+01:00, "H.J. Lu" <hjl.tools@gmail.com> wrote:
>On Fri, Nov 12, 2021 at 11:15 AM Richard Biener
><richard.guenther@gmail.com> wrote:
>>
>> On November 12, 2021 3:41:41 PM GMT+01:00, "H.J. Lu via Gcc-patches" <gcc-patches@gcc.gnu.org> wrote:
>> >On Fri, Nov 12, 2021 at 6:27 AM Martin Liška <mliska@suse.cz> wrote:
>> >>
>> >> On 11/8/21 15:19, Jeff Law wrote:
>> >> >
>> >> >
>> >> > On 11/8/2021 2:59 AM, Jakub Jelinek via Gcc-patches wrote:
>> >> >> On Mon, Nov 08, 2021 at 09:45:39AM +0100, Martin Liška wrote:
>> >> >>> This fixes issue reported in the PR.
>> >> >>>
>> >> >>> Ready to be installed?
>> >> >> I'm not sure.  liboffloadmic is copied from upstream, so the right
>> >> >> thing if we want to do anything at all (if we don't remove it, nothing
>> >> >> bad happens, the condition is never true anyway, whether removed away
>> >> >> in the source or removed by the compiler) would be to let Intel fix it in
>> >> >> their source and update from that.
>> >> >> But I have no idea where it even lives upstream.
>> >> > I thought MIC as an architecture was dead, so it could well be the case that there isn't a viable upstream anymore for that code.
>> >> >
>> >> > jeff
>> >>
>> >> @H.J. ?
>> >>
>> >
>> >We'd like to deprecate MIC offload in GCC 12.  We will remove all traces of
>> >MIC offload in GCC 13.
>>
>> Can you document that in gcc-12/changes.html in the caveats section please?
>>
>
>I will do that.
>
>Can you review my last wwwdocs change:
>
>https://gcc.gnu.org/pipermail/gcc-patches/2021-August/578344.html

That change is OK. 

Richard. 

>Thanks.
>


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

* Re: [PATCH] Remove dead code.
  2021-11-12 19:14         ` Richard Biener
@ 2021-11-12 19:18           ` H.J. Lu
  2021-11-12 19:52             ` Richard Biener
  0 siblings, 1 reply; 17+ messages in thread
From: H.J. Lu @ 2021-11-12 19:18 UTC (permalink / raw)
  To: Richard Biener
  Cc: H.J. Lu via Gcc-patches, Martin Liška, Hongtao Liu,
	Jakub Jelinek, Tobias Burnus

On Fri, Nov 12, 2021 at 11:15 AM Richard Biener
<richard.guenther@gmail.com> wrote:
>
> On November 12, 2021 3:41:41 PM GMT+01:00, "H.J. Lu via Gcc-patches" <gcc-patches@gcc.gnu.org> wrote:
> >On Fri, Nov 12, 2021 at 6:27 AM Martin Liška <mliska@suse.cz> wrote:
> >>
> >> On 11/8/21 15:19, Jeff Law wrote:
> >> >
> >> >
> >> > On 11/8/2021 2:59 AM, Jakub Jelinek via Gcc-patches wrote:
> >> >> On Mon, Nov 08, 2021 at 09:45:39AM +0100, Martin Liška wrote:
> >> >>> This fixes issue reported in the PR.
> >> >>>
> >> >>> Ready to be installed?
> >> >> I'm not sure.  liboffloadmic is copied from upstream, so the right
> >> >> thing if we want to do anything at all (if we don't remove it, nothing
> >> >> bad happens, the condition is never true anyway, whether removed away
> >> >> in the source or removed by the compiler) would be to let Intel fix it in
> >> >> their source and update from that.
> >> >> But I have no idea where it even lives upstream.
> >> > I thought MIC as an architecture was dead, so it could well be the case that there isn't a viable upstream anymore for that code.
> >> >
> >> > jeff
> >>
> >> @H.J. ?
> >>
> >
> >We'd like to deprecate MIC offload in GCC 12.  We will remove all traces of
> >MIC offload in GCC 13.
>
> Can you document that in gcc-12/changes.html in the caveats section please?
>

I will do that.

Can you review my last wwwdocs change:

https://gcc.gnu.org/pipermail/gcc-patches/2021-August/578344.html

Thanks.

-- 
H.J.

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

* Re: [PATCH] Remove dead code.
  2021-11-12 14:41       ` H.J. Lu
  2021-11-12 14:44         ` Martin Liška
@ 2021-11-12 19:14         ` Richard Biener
  2021-11-12 19:18           ` H.J. Lu
  1 sibling, 1 reply; 17+ messages in thread
From: Richard Biener @ 2021-11-12 19:14 UTC (permalink / raw)
  To: H.J. Lu, H.J. Lu via Gcc-patches, Martin Liška, Hongtao Liu
  Cc: Jakub Jelinek, GCC Patches, Tobias Burnus

On November 12, 2021 3:41:41 PM GMT+01:00, "H.J. Lu via Gcc-patches" <gcc-patches@gcc.gnu.org> wrote:
>On Fri, Nov 12, 2021 at 6:27 AM Martin Liška <mliska@suse.cz> wrote:
>>
>> On 11/8/21 15:19, Jeff Law wrote:
>> >
>> >
>> > On 11/8/2021 2:59 AM, Jakub Jelinek via Gcc-patches wrote:
>> >> On Mon, Nov 08, 2021 at 09:45:39AM +0100, Martin Liška wrote:
>> >>> This fixes issue reported in the PR.
>> >>>
>> >>> Ready to be installed?
>> >> I'm not sure.  liboffloadmic is copied from upstream, so the right
>> >> thing if we want to do anything at all (if we don't remove it, nothing
>> >> bad happens, the condition is never true anyway, whether removed away
>> >> in the source or removed by the compiler) would be to let Intel fix it in
>> >> their source and update from that.
>> >> But I have no idea where it even lives upstream.
>> > I thought MIC as an architecture was dead, so it could well be the case that there isn't a viable upstream anymore for that code.
>> >
>> > jeff
>>
>> @H.J. ?
>>
>
>We'd like to deprecate MIC offload in GCC 12.  We will remove all traces of
>MIC offload in GCC 13.

Can you document that in gcc-12/changes.html in the caveats section please?

Thanks, 
Richard. 

>


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

* Re: [PATCH] Remove dead code.
  2021-11-12 14:44         ` Martin Liška
@ 2021-11-12 15:00           ` H.J. Lu
  0 siblings, 0 replies; 17+ messages in thread
From: H.J. Lu @ 2021-11-12 15:00 UTC (permalink / raw)
  To: Martin Liška
  Cc: Hongtao Liu, Jeff Law, Jakub Jelinek, Tobias Burnus, GCC Patches

On Fri, Nov 12, 2021 at 6:44 AM Martin Liška <mliska@suse.cz> wrote:
>
> On 11/12/21 15:41, H.J. Lu wrote:
> > On Fri, Nov 12, 2021 at 6:27 AM Martin Liška <mliska@suse.cz> wrote:
> >>
> >> On 11/8/21 15:19, Jeff Law wrote:
> >>>
> >>>
> >>> On 11/8/2021 2:59 AM, Jakub Jelinek via Gcc-patches wrote:
> >>>> On Mon, Nov 08, 2021 at 09:45:39AM +0100, Martin Liška wrote:
> >>>>> This fixes issue reported in the PR.
> >>>>>
> >>>>> Ready to be installed?
> >>>> I'm not sure.  liboffloadmic is copied from upstream, so the right
> >>>> thing if we want to do anything at all (if we don't remove it, nothing
> >>>> bad happens, the condition is never true anyway, whether removed away
> >>>> in the source or removed by the compiler) would be to let Intel fix it in
> >>>> their source and update from that.
> >>>> But I have no idea where it even lives upstream.
> >>> I thought MIC as an architecture was dead, so it could well be the case that there isn't a viable upstream anymore for that code.
> >>>
> >>> jeff
> >>
> >> @H.J. ?
> >>
> >
> > We'd like to deprecate MIC offload in GCC 12.  We will remove all traces of
> > MIC offload in GCC 13.
>
> I see. So do you want the patch to be installed or not?
>

I prefer to leave it alone and close the PR with WONTFIX.

-- 
H.J.

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

* Re: [PATCH] Remove dead code.
  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
  1 sibling, 1 reply; 17+ messages in thread
From: Martin Liška @ 2021-11-12 14:44 UTC (permalink / raw)
  To: H.J. Lu, Hongtao Liu; +Cc: Jeff Law, Jakub Jelinek, Tobias Burnus, GCC Patches

On 11/12/21 15:41, H.J. Lu wrote:
> On Fri, Nov 12, 2021 at 6:27 AM Martin Liška <mliska@suse.cz> wrote:
>>
>> On 11/8/21 15:19, Jeff Law wrote:
>>>
>>>
>>> On 11/8/2021 2:59 AM, Jakub Jelinek via Gcc-patches wrote:
>>>> On Mon, Nov 08, 2021 at 09:45:39AM +0100, Martin Liška wrote:
>>>>> This fixes issue reported in the PR.
>>>>>
>>>>> Ready to be installed?
>>>> I'm not sure.  liboffloadmic is copied from upstream, so the right
>>>> thing if we want to do anything at all (if we don't remove it, nothing
>>>> bad happens, the condition is never true anyway, whether removed away
>>>> in the source or removed by the compiler) would be to let Intel fix it in
>>>> their source and update from that.
>>>> But I have no idea where it even lives upstream.
>>> I thought MIC as an architecture was dead, so it could well be the case that there isn't a viable upstream anymore for that code.
>>>
>>> jeff
>>
>> @H.J. ?
>>
> 
> We'd like to deprecate MIC offload in GCC 12.  We will remove all traces of
> MIC offload in GCC 13.

I see. So do you want the patch to be installed or not?

Cheers,
Martin

> 
> 


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

* Re: [PATCH] Remove dead code.
  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 19:14         ` Richard Biener
  0 siblings, 2 replies; 17+ messages in thread
From: H.J. Lu @ 2021-11-12 14:41 UTC (permalink / raw)
  To: Martin Liška, Hongtao Liu
  Cc: Jeff Law, Jakub Jelinek, Tobias Burnus, GCC Patches

On Fri, Nov 12, 2021 at 6:27 AM Martin Liška <mliska@suse.cz> wrote:
>
> On 11/8/21 15:19, Jeff Law wrote:
> >
> >
> > On 11/8/2021 2:59 AM, Jakub Jelinek via Gcc-patches wrote:
> >> On Mon, Nov 08, 2021 at 09:45:39AM +0100, Martin Liška wrote:
> >>> This fixes issue reported in the PR.
> >>>
> >>> Ready to be installed?
> >> I'm not sure.  liboffloadmic is copied from upstream, so the right
> >> thing if we want to do anything at all (if we don't remove it, nothing
> >> bad happens, the condition is never true anyway, whether removed away
> >> in the source or removed by the compiler) would be to let Intel fix it in
> >> their source and update from that.
> >> But I have no idea where it even lives upstream.
> > I thought MIC as an architecture was dead, so it could well be the case that there isn't a viable upstream anymore for that code.
> >
> > jeff
>
> @H.J. ?
>

We'd like to deprecate MIC offload in GCC 12.  We will remove all traces of
MIC offload in GCC 13.


-- 
H.J.

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

* Re: [PATCH] Remove dead code.
  2021-11-08 14:19   ` Jeff Law
@ 2021-11-12 14:27     ` Martin Liška
  2021-11-12 14:41       ` H.J. Lu
  0 siblings, 1 reply; 17+ messages in thread
From: Martin Liška @ 2021-11-12 14:27 UTC (permalink / raw)
  To: Jeff Law, Jakub Jelinek, hjl.tools; +Cc: Tobias Burnus, gcc-patches

On 11/8/21 15:19, Jeff Law wrote:
> 
> 
> On 11/8/2021 2:59 AM, Jakub Jelinek via Gcc-patches wrote:
>> On Mon, Nov 08, 2021 at 09:45:39AM +0100, Martin Liška wrote:
>>> This fixes issue reported in the PR.
>>>
>>> Ready to be installed?
>> I'm not sure.  liboffloadmic is copied from upstream, so the right
>> thing if we want to do anything at all (if we don't remove it, nothing
>> bad happens, the condition is never true anyway, whether removed away
>> in the source or removed by the compiler) would be to let Intel fix it in
>> their source and update from that.
>> But I have no idea where it even lives upstream.
> I thought MIC as an architecture was dead, so it could well be the case that there isn't a viable upstream anymore for that code.
> 
> jeff

@H.J. ?

Martin

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

* Re: [PATCH] Remove dead code.
  2021-11-08  8:59 ` Jakub Jelinek
@ 2021-11-08 14:19   ` Jeff Law
  2021-11-12 14:27     ` Martin Liška
  0 siblings, 1 reply; 17+ messages in thread
From: Jeff Law @ 2021-11-08 14:19 UTC (permalink / raw)
  To: Jakub Jelinek, Martin Liška, hjl.tools; +Cc: Tobias Burnus, gcc-patches



On 11/8/2021 2:59 AM, Jakub Jelinek via Gcc-patches wrote:
> On Mon, Nov 08, 2021 at 09:45:39AM +0100, Martin Liška wrote:
>> This fixes issue reported in the PR.
>>
>> Ready to be installed?
> I'm not sure.  liboffloadmic is copied from upstream, so the right
> thing if we want to do anything at all (if we don't remove it, nothing
> bad happens, the condition is never true anyway, whether removed away
> in the source or removed by the compiler) would be to let Intel fix it in
> their source and update from that.
> But I have no idea where it even lives upstream.
I thought MIC as an architecture was dead, so it could well be the case 
that there isn't a viable upstream anymore for that code.

jeff

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

* Re: [PATCH] Remove dead code.
  2021-11-08  8:45 Martin Liška
@ 2021-11-08  8:59 ` Jakub Jelinek
  2021-11-08 14:19   ` Jeff Law
  0 siblings, 1 reply; 17+ messages in thread
From: Jakub Jelinek @ 2021-11-08  8:59 UTC (permalink / raw)
  To: Martin Liška, hjl.tools; +Cc: gcc-patches, Tobias Burnus

On Mon, Nov 08, 2021 at 09:45:39AM +0100, Martin Liška wrote:
> This fixes issue reported in the PR.
> 
> Ready to be installed?

I'm not sure.  liboffloadmic is copied from upstream, so the right
thing if we want to do anything at all (if we don't remove it, nothing
bad happens, the condition is never true anyway, whether removed away
in the source or removed by the compiler) would be to let Intel fix it in
their source and update from that.
But I have no idea where it even lives upstream.

	Jakub


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

* [PATCH] Remove dead code.
@ 2021-11-08  8:45 Martin Liška
  2021-11-08  8:59 ` Jakub Jelinek
  0 siblings, 1 reply; 17+ 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] 17+ messages in thread

* [PATCH] Remove dead code
@ 2020-06-09 14:01 Richard Biener
  0 siblings, 0 replies; 17+ 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] 17+ messages in thread

* [PATCH] Remove dead code
@ 2019-09-18 12:42 Richard Biener
  0 siblings, 0 replies; 17+ 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] 17+ messages in thread

* [PATCH] Remove dead code
@ 2019-09-03 10:27 Richard Biener
  0 siblings, 0 replies; 17+ 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] 17+ messages in thread

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

On 05/04/2015 05:50 AM, Dominik Vogt wrote:
> 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.
OK.  Please install.

FWIW, removing a write-only variable seems like it ought ot fall under 
the obvious rule.

jeff

^ permalink raw reply	[flat|nested] 17+ 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; 17+ 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] 17+ messages in thread

* [PATCH] Remove dead code
@ 2013-01-16 14:51 Richard Biener
  0 siblings, 0 replies; 17+ 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] 17+ messages in thread

end of thread, other threads:[~2021-11-12 19:52 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-09 16:24 [PATCH] Remove dead code Richard Biener
  -- strict thread matches above, loose matches on Subject: below --
2021-11-08  8:45 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
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).