This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[4.4 PATCH] Add 2 mark_symbols_for_rename calls to vectorizable_call
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Guenther <rguenther at suse dot de>, irar at il dot ibm dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 25 Sep 2009 15:13:46 +0200
- Subject: [4.4 PATCH] Add 2 mark_symbols_for_rename calls to vectorizable_call
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
On redhat/gcc-4_4-branch (which contains a backport of power7 changes) many
the compiler ICEs on many SPEC2k6 sources with -O3 -mcpu=power7. The
problem is that while e.g. __builtin_sqrt{,f} with -ffast-math is
DECL_IS_NOVOPS, when the vectorizer replaces it with __builtin_vsx_*
builtins which don't have any special attributes, it fails to
mark_symbols_for_renaming and thus some variables in VOPS of the new builtin
stay not in SSA form.
While Michael is working on proper attributes for the power builtins and
i386 builtins often have TREE_READONLY set (which is probably not right for
builtins that rely on floating point rounding mode), I think the vectorizer
should be fixed too.
This is what I've bootstrapped/regtested on vanilla 4.4 branch on
x86_64-linux and i686-linux. I don't have a testcase for vanilla 4.4, nor
for vanilla 4.5 (where the added VOPS apparently don't need renaming), so
I'm posting this patch just in case we want it in 4.4 and/or 4.5 (for 4.5
it would go into tree-vect-stmts.c of course). If not, I can keep it on
redhat/gcc-4_4-branch.
2009-09-25 Jakub Jelinek <jakub@redhat.com>
* tree-vect-transform.c (vectorizable_call): Call
mark_symbols_for_renaming after vect_finish_stmt_generation.
--- gcc/tree-vect-transform.c.jj 2009-04-20 21:20:46.000000000 +0200
+++ gcc/tree-vect-transform.c 2009-09-25 09:04:52.000000000 +0200
@@ -3386,6 +3386,7 @@ vectorizable_call (gimple stmt, gimple_s
gimple_call_set_lhs (new_stmt, new_temp);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
+ mark_symbols_for_renaming (new_stmt);
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
@@ -3433,6 +3434,7 @@ vectorizable_call (gimple stmt, gimple_s
gimple_call_set_lhs (new_stmt, new_temp);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
+ mark_symbols_for_renaming (new_stmt);
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = new_stmt;
Jakub