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] default_add_stmt_cost should call target specific builitin_vectorization_cost.


On Fri, Jun 6, 2014 at 10:52 AM, Bingfeng Mei <bmei@broadcom.com> wrote:
> Hi,
> I came across this issue a while back. My colleague Paulo Matos asked
> and it was agreed that this is a bug. But he forgot to submit a patch.
>
> default_add_stmt_cost should call target specific builtin_vectozriation_cost.
> instead of default_builtin_vectorization_cost directly. So if the hook
> TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST is defined, it will use that cost.
> Otherwise, it will fall back to default_builtin_vectorization_cost.
>
> Bootstrapped and tested. OK for trunk?

Ok.  (though that target hook should be removed at some point)

Thanks,
Richard.

> Thanks,
> Bingfeng Mei
>
> Index: gcc/ChangeLog
> ===================================================================
> --- gcc/ChangeLog       (revision 211281)
> +++ gcc/ChangeLog       (working copy)
> @@ -1,3 +1,8 @@
> +2014-06-05  Bingfeng Mei  <bmei@broadcom.com>
> +
> +       * targhooks.c (default_add_stmt_cost): Call target specific
> +       hook instead of default one.
> +
>  2014-06-05  Ilya Enkovich  <ilya.enkovich@intel.com>
>
>         * tree-inline.c (tree_function_versioning): Check DF info existence
> Index: gcc/targhooks.c
> ===================================================================
> --- gcc/targhooks.c     (revision 211281)
> +++ gcc/targhooks.c     (working copy)
> @@ -1073,8 +1073,8 @@ default_add_stmt_cost (void *data, int c
>    unsigned retval = 0;
>
>    tree vectype = stmt_info ? stmt_vectype (stmt_info) : NULL_TREE;
> -  int stmt_cost = default_builtin_vectorization_cost (kind, vectype,
> -                                                         misalign);
> +  int stmt_cost = targetm.vectorize.builtin_vectorization_cost (kind, vectype,
> +                                                               misalign);
>     /* Statements in an inner loop relative to the loop being
>        vectorized are weighted more heavily.  The value here is
>        arbitrary and could potentially be improved with analysis.  */


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