[PATCH] DCE dead IFN_GOMP_SIMD_LANE

Jakub Jelinek jakub@redhat.com
Fri Nov 14 17:42:00 GMT 2014


Hi!

When looking at PR59984, I've noticed that in certain cases we leave
around GOMP_SIMD_LANE calls without lhs.
This internal call is intentionally not ECF_CONST, we don't want it moved
before the loop, and the argument is magic.  But, if nothing uses it
anymore, it isn't needed.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
trunk?

2014-11-14  Jakub Jelinek  <jakub@redhat.com>

	* tree-ssa.dce.c (eliminate_unnecessary_stmts): Eliminate
	IFN_GOMP_SIMD_LANE without lhs as useless.

--- gcc/tree-ssa-dce.c.jj	2014-11-12 13:28:47.000000000 +0100
+++ gcc/tree-ssa-dce.c	2014-11-14 16:15:10.356124955 +0100
@@ -1402,6 +1402,11 @@ eliminate_unnecessary_stmts (void)
 		  maybe_clean_or_replace_eh_stmt (stmt, stmt);
 		  update_stmt (stmt);
 		  release_ssa_name (name);
+
+		  /* GOMP_SIMD_LANE without lhs is not needed.  */
+		  if (gimple_call_internal_p (stmt)
+		      && gimple_call_internal_fn (stmt) == IFN_GOMP_SIMD_LANE)
+		    remove_dead_stmt (&gsi, bb);
 		}
 	      else if (gimple_call_internal_p (stmt))
 		switch (gimple_call_internal_fn (stmt))

	Jakub



More information about the Gcc-patches mailing list