On 21 October 2011 14:52, Jakub Jelinek <ja...@redhat.com> wrote: > On Fri, Oct 21, 2011 at 02:37:06PM +0200, Ira Rosen wrote: >> > @@ -1620,7 +1615,13 @@ vectorizable_call (gimple stmt, gimple_s >> > >> > gcc_assert (!gimple_vuse (stmt)); >> > >> > - if (modifier == NARROW) >> > + if (slp_node || PURE_SLP_STMT (stmt_info)) >> > + { >> > + if (modifier != NONE) >> > + return false; >> > + ncopies = 1; >> > + } >> >> If you want to bail out if it's SLP and modifier != NONE, this check >> is not enough. PURE_SLP means the stmt is not used outside the SLP >> instance, so for hybrid SLP stmts (those that have uses outside SLP) >> this check will not work. You need >> >> if (modifier != NONE && STMT_SLP_TYPE (stmt_info)) >> return false; > > I just blindly copied what vectorizable_operation does, without > too much understanding what PURE_SLP_STMT or STMT_SLP_TYPE etc. mean. > Didn't get that far. > But modifier != NONE && something would sometimes allow modifier != NONE > through, which at least the current code isn't prepared to handle. > Did you mean || instead?
But it's OK to allow modifier != NONE if it's not SLP, so we need &&, no? Something like: if (modifier != NONE && STMT_SLP_TYPE (stmt_info)) return false; if (slp_node || PURE_SLP_STMT (stmt_info)) ncopies = 1; else if (modifier == NARROW) ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_out; else ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_in; > >> But I wonder why not allow different type sizes? I see that we fail in >> such cases in vectorizable_conversion too, but I think we should >> support this as well. > > Merely because I don't know SLP enough, vectorizable_operation also > handles just same size to same size, so I didn't have good examples > on how to do it. For loops narrowing or widening operations are > handled through ncopies != 1, but for SLP it seems it is always > asserted it is 1... There are vectorizable_type_promotion/demotion, and for the rest the copies are "hidden" inside multiple vector operands that you get from vect_get_vec_defs. But, of course, there is not need to handle modifier == NARROW for SLP at the moment. I was just wondering out loud. Ira > > Jakub >