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: [autovect] [patch] enchance vectorizer for ivs after loop


> committed to the branch.
>

oops, I haven't seen Dan's and Zdenek's comments before committing... we
may want to reconsider this patch. probably a mainline merge is due, so we
could enable scev_const_prop on the branch, and re-evaluate the need for
the patch.

thanks,
dorit

> thanks,
> dorit
>
> Victor Kaplansky/Haifa/IBM wrote on 08/02/2006 21:53:52:
>
> > Hello,
> >
> > on loops like
> >
> > for (i = 0; i < 64; i++)
> >   {
> >     x = 10 * i + 5;
> >     A[i] = B[i];
> >   }
> >
> > use (x);
> >
> > vectorizer should optimize to
> >
> > A[0:63] = B[0:63];
> > use (635);
> >
> > but the vectorizer gives up since number of iterations should be
changed
> but
> > value of x must be preserved. This patch enhances vectorizer to perform
> this
> > optimization and adds some testcases for this new feature.
> >
> > Bootstrapped & regtested on ppc64-yellowdog-linux
> >
> > -- victor
> >
> > 2006-02-08  Dorit Nuzman  <dorit@il.ibm.com>
> >             Victor Kaplansky <victork@il.ibm.com>
> >
> >         * tree-vectorizer.c (new_stmt_vec_info): Initialize new field.
> >         (vect_is_simple_live_use): New function, similar to old
> >         vect_is_simple_use, but permits induction variables.
> >         (vect_is_simple_use): Changed to use new
vect_is_simple_live_use.
> >         * tree-vectorizer.h: (struct _stmt_vec_info): New field,
> >         epilog_stmt and macro for its access.
> >         (vect_is_simple_live_use): New function declaration.
> >         * tree-vect-analyze.c (vect_analyze_operations): Do not return
> false
> >         if vectorizable_live_operation returns true.
> >         (vect_mark_stmts_to_be_vectorized): Mark statement to be
> vectorized
> >         if it is simple live use.
> >         * tree-vect-transform.c (vect_get_epilog_def_for_operand): New
> >         function.
> >         (vectorizable_live_operation): Enhance code to insert
calculation
> >         of final value of simple use ivs before epilog. Replace uses
> >         of PHI_RESULT in relevant exit_phi with the newly created def.
> >         (vect_transform_stmt): Takes additional argument.
> >         (advance_iv_by_n): New function.
> >         (vect_update_ivs_after_vectorizer): Factor out into
> advance_iv_by_n
> >         with a call to advance_iv_by_n.
> >
> > [attachment "autovect.ivs-used-after-loop.patch.txt" deleted by
> > Dorit Nuzman/Haifa/IBM]
>


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