This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH GCC8][14/33]Handle more cheap operations in force_expr_to_var_cost
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Bin Cheng <Bin dot Cheng at arm dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, nd <nd at arm dot com>
- Date: Wed, 26 Apr 2017 14:58:15 +0200
- Subject: Re: [PATCH GCC8][14/33]Handle more cheap operations in force_expr_to_var_cost
- Authentication-results: sourceware.org; auth=none
- References: <VI1PR0802MB2176E1CEFF7CE6F25CFF7A3DE7190@VI1PR0802MB2176.eurprd08.prod.outlook.com>
On Tue, Apr 18, 2017 at 12:44 PM, Bin Cheng <Bin.Cheng@arm.com> wrote:
> Hi,
> This patch handles more cheap cases in function force_expr_to_var_cost, specifically,
> TRUNC_DIV_EXPR, BIT_AND_EXPR, BIT_IOR_EXPR, RSHIFT_EXPR and BIT_NOT_EXPR.
>
> Is it OK?
I wonder if using add_cost is good here. TRUNC_DIV by power of two
better matches
shift_cost, no, or div_pow2_cheap? Likewise for LSHIFT/RSHIFT. We do
have [us]div_cost as well btw.
And we have neg_cost.
I mean if we're going all the way of using target based costs in
force_expr_to_var_cost rather
than estimate_num_insns then we should do as good as we can?
Richard.
> Thanks,
> bin
> 2017-04-11 Bin Cheng <bin.cheng@arm.com>
>
> * tree-ssa-loop-ivopts.c (force_expr_to_var_cost): Handle more
> operators: TRUNC_DIV_EXPR, BIT_AND_EXPR, BIT_IOR_EXPR, RSHIFT_EXPR
> and BIT_NOT_EXPR.