On 30/05/2016 14:22, "Richard Biener" <richard.guent...@gmail.com> wrote:
>On Fri, May 27, 2016 at 5:12 PM, Alan Hayward <alan.hayw...@arm.com> >wrote: >> >> On 27/05/2016 12:41, "Richard Biener" <richard.guent...@gmail.com> >>wrote: >> >>>On Fri, May 27, 2016 at 11:09 AM, Alan Hayward <alan.hayw...@arm.com> >>>wrote: >> >>> >>>The rest of the changes look ok to me. >> >> Does that include PATCH 1/3 ? > >I don't like how 1/3 ends up looking :/ So what was the alternative >again? >I looked into 1/3 and what it takes to remove the 'stmt' argument and >instead pass in a vect_def_type. It's a bit twisted and just adding >another >argument (the loop_vinfo) doesn't help things here. > >So - instead of 1/3 you might want to split out a function > >tree >vect_get_vec_def_for_operand_1 (gimple *def_stmt, enum vect_def_type >dt, tree vectype) >{ > switch (dt) > { >... > } >} > >and for constant/external force vectype != NULL. I’m still a little confused as to exactly what you want here. From your two comments I think you wanted me to completely remove the boolean type check and the vect_init_vector call. But if I remove that then other code paths will break. However, I’ve just realised that in vectorized_live_operation I already have the def stmt and I can easily get hold of dt from STMT_VINFO_DEF_TYPE. Which means I can call vect_get_vec_def_for_operand_1 from vectorized_live_operation. I’ve put together a version where I have: tree vect_get_vec_def_for_operand_1 (gimple *def_stmt, enum vect_def_type dt) { switch (dt) { case vect_internal_def || vect_external_def: gcc_unreachable () .. code for for all other cases.. } } /* Used by existing code */ tree vect_get_vec_def_for_operand (tree op, gimple *stmt, tree vectype) { vect_is_simple_use(op, loop_vinfo, &def_stmt, &dt); ..and the dump code If dt == internal_def || vect_external_def: .. Check for BOOLEAN_TYPE .. return vect_init_vector (stmt, op, vector_type, NULL); else vect_get_vec_def_for_operand_1 (def_stmt, dt) } Does that look better? Alan.