This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Fix realignment code in the vectorizer


Following the correspondence here
http://gcc.gnu.org/ml/gcc/2006-09/msg00271.html: when creating realign_load
stmt in vectorizable_load (tree-vect-transform.c), use the type of the
return value of the mask_for_load builtin.

Bootstrapped and tested on ppc-linux.

Ira

:ADDPATCH SSA (vectorizer):

ChangeLog entry:

      * tree-vect-transform.c (vectorizable_load): Use the type of the
      return value of the mask_for_load builtin to create realign_load
stmt.


Patch:

Index: tree-vect-transform.c
===================================================================
--- tree-vect-transform.c       (revision 117455)
+++ tree-vect-transform.c       (working copy)
@@ -1916,10 +1916,12 @@ vectorizable_load (tree stmt, block_stmt
          /* Create permutation mask, if required, in loop preheader.  */
          tree builtin_decl;
          params = build_tree_list (NULL_TREE, init_addr);
-         vec_dest = vect_create_destination_var (scalar_dest, vectype);
          builtin_decl = targetm.vectorize.builtin_mask_for_load ();
          new_stmt = build_function_call_expr (builtin_decl, params);
-         new_stmt = build2 (MODIFY_EXPR, vectype, vec_dest, new_stmt);
+         vec_dest = vect_create_destination_var (scalar_dest,
+                                                 TREE_TYPE (new_stmt));
+         new_stmt = build2 (MODIFY_EXPR, TREE_TYPE (vec_dest), vec_dest,
+                            new_stmt);
          new_temp = make_ssa_name (vec_dest, new_stmt);
          TREE_OPERAND (new_stmt, 0) = new_temp;
          new_bb = bsi_insert_on_edge_immediate (pe, new_stmt);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]