Hi, Does this patch fix the problem?
Ira Index: tree-vect-transform.c =================================================================== --- tree-vect-transform.c (revision 117002) +++ tree-vect-transform.c (working copy) @@ -1916,10 +1916,10 @@ 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); Dorit Nuzman/Haifa/IBM wrote on 16/09/2006 12:37:28: > > I'm trying to add a hook for aligning vectors for loads. > > > > I'm using the altivec rs6000 code as a baseline. > > > > However, the instruction is like the iwmmxt_walign instruction in the > > ARM port; it takes > > a normalish register and uses the bottom bits... it doesn't use a > > full-width vector. > > > > GCC complains when my builtin pointed to by > > TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD yields a QImode result, because > > it has no way of converting that to the vector moe it is expecting. I > > Looks like it's a bug in the vectorizer - we treat both the return > value of the mask_for_load builtin, and the 3rd argument to the > realign_load stmt (e.g. Altivec's vperm), as variables of type > 'vectype', instead of obtaining the type from the target machine > description. All we need to care about is that these two variables > have the same type. I'll look into that > > dorit > > > think the altivec side would have a similar problem, as the expected > > RTX output RTX is: > > > > (reg:V8HI 131 [ vect_var_.2540 ]) > > > > but it changes that to: > > > > (reg:V16QI 160) > > > > for the VLSR instruction. V16QImode is what VPERM expects, and I > > think since V8HI and V16QI mode are the same size everyone is happy. > > > > Is there a way to tell GCC what the type of the > > TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD should be? Looking at > > http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gccint/Addressing-Modes. > > html#Addressing-Modes > > it reads like it must merely match the last operand of the > > vec_realign_load_<mode> pattern. > > > > -- > > Why are ``tolerant'' people so intolerant of intolerant people?