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 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...
> No need in \n.
Ok.
> > for (i = 0; i < number_of_oprnds; i++)
> > {
> > - oprnd = gimple_op (stmt, i + 1);
> > + if (is_gimple_call (stmt))
> > + oprnd = gimple_call_arg (stmt, i);
> > + else
> > + oprnd = gimple_op (stmt, i + 1);
> >
> > if (!vect_is_simple_use (oprnd, loop_vinfo, bb_vinfo, &def_stmt,
> > &def[i],
> > &dt[i])
>
> I think you forgot to check that all the calls are to the same function.
Right, that is easy to add, but modifier != NONE is something I have no idea
how to do currently.
Jakub