This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] default_add_stmt_cost should call target specific builitin_vectorization_cost.
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Bingfeng Mei <bmei at broadcom dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 6 Jun 2014 11:40:19 +0200
- Subject: Re: [PATCH] default_add_stmt_cost should call target specific builitin_vectorization_cost.
- Authentication-results: sourceware.org; auth=none
- References: <B71DF1153024A14EABB94E39368E44A6042C803C at SJEXCHMB13 dot corp dot ad dot broadcom dot com>
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. */