public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Remove duplicated GOMP SIMD LANE code
@ 2016-06-02 16:03 Alan Hayward
  2016-06-03 11:04 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Hayward @ 2016-06-02 16:03 UTC (permalink / raw)
  To: gcc-patches

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

The IFN_GOMP_SIMD_LANE code in vectorizable_call is essentially a
duplicate of
the code in vectorizable_live_operation. They both replace all uses
outside the
loop with the constant VF - 1.

Note that my patch to vectorize inductions that are live after the loop
will
also remove the IFN_GOMP_SIMD_LANE code in vectorizable_live_operation.

This patch is required in order for the follow on optimisation (No need to
Vectorise simple only-live stmts) to work.

Tested with libgomp on x86 and aarch64

gcc/
    * tree-vect-stmts.c (vectorizable_call) Remove GOMP_SIMD_LANE code.

Alan.


[-- Attachment #2: duplicatedGOMP.patch --]
[-- Type: application/octet-stream, Size: 1245 bytes --]

diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 1ef924a4aa07aa626a603f5fb59bf991a89c1d9a..373ecd7278d2c4edbd1191349bee389b97f0c321 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -2654,29 +2654,6 @@ vectorizable_call (gimple *gs, gimple_stmt_iterator *gsi, gimple **vec_stmt,
   else
     lhs = gimple_call_lhs (stmt);
 
-  if (gimple_call_internal_p (stmt)
-      && gimple_call_internal_fn (stmt) == IFN_GOMP_SIMD_LANE)
-    {
-      /* Replace uses of the lhs of GOMP_SIMD_LANE call outside the loop
-	 with vf - 1 rather than 0, that is the last iteration of the
-	 vectorized loop.  */
-      imm_use_iterator iter;
-      use_operand_p use_p;
-      gimple *use_stmt;
-      FOR_EACH_IMM_USE_STMT (use_stmt, iter, lhs)
-	{
-	  basic_block use_bb = gimple_bb (use_stmt);
-	  if (use_bb
-	      && !flow_bb_inside_loop_p (LOOP_VINFO_LOOP (loop_vinfo), use_bb))
-	    {
-	      FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
-		SET_USE (use_p, build_int_cst (TREE_TYPE (lhs),
-					       ncopies * nunits_out - 1));
-	      update_stmt (use_stmt);
-	    }
-	}
-    }
-
   new_stmt = gimple_build_assign (lhs, build_zero_cst (type));
   set_vinfo_for_stmt (new_stmt, stmt_info);
   set_vinfo_for_stmt (stmt, NULL);

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

* Re: Remove duplicated GOMP SIMD LANE code
  2016-06-02 16:03 Remove duplicated GOMP SIMD LANE code Alan Hayward
@ 2016-06-03 11:04 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2016-06-03 11:04 UTC (permalink / raw)
  To: Alan Hayward; +Cc: gcc-patches

On Thu, Jun 2, 2016 at 6:03 PM, Alan Hayward <alan.hayward@arm.com> wrote:
> The IFN_GOMP_SIMD_LANE code in vectorizable_call is essentially a
> duplicate of
> the code in vectorizable_live_operation. They both replace all uses
> outside the
> loop with the constant VF - 1.
>
> Note that my patch to vectorize inductions that are live after the loop
> will
> also remove the IFN_GOMP_SIMD_LANE code in vectorizable_live_operation.
>
> This patch is required in order for the follow on optimisation (No need to
> Vectorise simple only-live stmts) to work.
>
> Tested with libgomp on x86 and aarch64

Ok.

Thanks,
Richard.

> gcc/
>     * tree-vect-stmts.c (vectorizable_call) Remove GOMP_SIMD_LANE code.
>
> Alan.
>

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

end of thread, other threads:[~2016-06-03 11:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-02 16:03 Remove duplicated GOMP SIMD LANE code Alan Hayward
2016-06-03 11:04 ` 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).