This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] DCE dead IFN_GOMP_SIMD_LANE
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 14 Nov 2014 18:33:47 +0100
- Subject: [PATCH] DCE dead IFN_GOMP_SIMD_LANE
- Authentication-results: sourceware.org; auth=none
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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