This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH GCC]Compute, cache and use cost of auto-increment rtx patterns in IVOPT
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: "bin.cheng" <bin dot cheng at arm dot com>, Bernd Schmidt <bernds at codesourcery dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 4 Nov 2013 12:38:19 +0100
- Subject: Re: [PATCH GCC]Compute, cache and use cost of auto-increment rtx patterns in IVOPT
- Authentication-results: sourceware.org; auth=none
- References: <001001ced90e$4ecd9af0$ec68d0d0$ at arm dot com>
On Mon, Nov 4, 2013 at 4:31 AM, bin.cheng <email@example.com> wrote:
> The IVOPT in GCC has a problem that it does not use cost of auto-increment
> address expression in accounting, while it retreats to cost of address
> expression if auto-increment addressing mode is unavailable.
> For example, on ARM target:
> 1) the cost of "[reg]" (which is 6) is used for address expression "[reg],
> 2) the cost of "[reg+off]" (which is 2) is used for address expression
> "[reg, #off]!";
> This causes:
> 1) cost of non-auto increment address expression is used for auto-increment
> address expression;
> 2) different address costs are used for pre/post increment address
> This patch fixes the problem by computing, caching and using the cost of
> auto-increment address expressions.
> Bootstrap and test on x86/arm. Is it OK?
But don't you need to adjust
determine_use_iv_cost_address (struct ivopts_data *data,
struct iv_use *use, struct iv_cand *cand)
int inv_expr_id = -1;
comp_cost cost = get_computation_cost (data, use, cand, true, &depends_on,
if (cand->ainc_use == use)
cost.cost -= cand->cost_step;
this which seems to try to compensate for your issue?
Or maybe I don't understand.
CCing Bernd who implemented this IIRC.
> 2013-11-01 Bin Cheng <firstname.lastname@example.org>
> * tree-ssa-loop-ivopts.c (enum ainc_type): New.
> (address_cost_data): New field.
> (get_address_cost): Compute auto-increment rtx cost in ainc_costs.
> Use ainc_costs for auto-increment rtx patterns.
> Cleanup TWS.