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]

Re: [PATCH] Teach the vectorizer about multiple sizes


On Thu, 7 Oct 2010, Ira Rosen wrote:

> >    * tree-vect-loop.c (vect_analyze_loop_3): Split out core part
> >    of vect_analyze_loop here.
> >    (vect_analyze_loop): Loop over vector sizes calling
> vect_analyze_loop_3.
> 
> You mean vect_analyze_loop_2, right?

Indeed.

> >
> > ! /* Function vect_analyze_loop_2.
> >
> >      Apply a set of analyses on LOOP, and create a loop_vec_info struct
> >      for it.  The different analyses will record information in the
> >      loop_vec_info struct.  */
> > ! static bool
> > ! vect_analyze_loop_2 (loop_vec_info loop_vinfo)
> >   {
> >     bool ok, dummy;
> >     int max_vf = MAX_VECTORIZATION_FACTOR;
> >     int min_vf = 2;
> 
> Is max_vf/min_vf computation redundant now?

I have to think about this and will followup with a patch to remove
it if it indeed is.

> >
> > !   do
> > !     {
> > !       /* Check the CFG characteristics of the loop (nesting,
> > entry/exit).  */
> > !       loop_vinfo = vect_analyze_loop_form (loop);
> > !       if (!loop_vinfo)
> > !    {
> > !      if (vect_print_dump_info (REPORT_DETAILS))
> > !        fprintf (vect_dump, "bad loop form.");
> > !      return NULL;
> > !    }
> 
> I think this part can be done outside the do-loop if
> 
>   loop_vinfo = new_loop_vec_info (loop);
>   LOOP_VINFO_NITERS (loop_vinfo) = number_of_iterations;
>   LOOP_VINFO_NITERS_UNCHANGED (loop_vinfo) = number_of_iterations;
> 
> is moved from vect_analyze_loop_form to this function.

I looked at this and it is not quite that easy.  In principle
we should be able to even share dataref and dependence analysis
(but those end up setting vector types on statements and splitting
that apart and moving it elsewhere causes some fallout, etc.).
So the patch for now goes the pragmatic way of re-starting
all over.  An incremental improvement would be to not re-allocate
loop_vinfo but only free selected parts.

I prefer to not complicate the existing patch.

Thanks,
Richard.

> 
> Thanks,
> Ira
> 
> 

-- 
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex


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