This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Add copy_rtx call to RTL loop unroller
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org,Richard Sandiford <richard dot sandiford at linaro dot org>
- Date: Wed, 20 Sep 2017 17:02:27 +0200
- Subject: Re: Add copy_rtx call to RTL loop unroller
- Authentication-results: sourceware.org; auth=none
- References: <87377h1rne.fsf@linaro.org>
On September 20, 2017 2:27:49 PM GMT+02:00, Richard Sandiford <richard.sandiford@linaro.org> wrote:
>This is needed if the step is an unshared constant, like many
>(const ...)s are. Without this patch, libgfortran would fail
>to build for SVE.
>
>Tested on aarch64-linux-gnu, x86_64-linux-gnu and
>powerpc64le-linus-gnu.
>OK to install?
OK.
Richard.
>Richard
>
>
>2017-09-20 Richard Sandiford <richard.sandiford@linaro.org>
> Alan Hayward <alan.hayward@arm.com>
> David Sherwood <david.sherwood@arm.com>
>
>gcc/
> * loop-unroll.c (split_iv): Call copy_rtx on the step.
>
>Index: gcc/loop-unroll.c
>===================================================================
>--- gcc/loop-unroll.c 2017-08-30 12:13:52.715828832 +0100
>+++ gcc/loop-unroll.c 2017-09-20 13:26:14.451718893 +0100
>@@ -1731,7 +1731,8 @@ split_iv (struct iv_to_split *ivts, rtx_
> else
> {
> incr = simplify_gen_binary (MULT, mode,
>- ivts->step, gen_int_mode (delta, mode));
>+ copy_rtx (ivts->step),
>+ gen_int_mode (delta, mode));
> expr = simplify_gen_binary (PLUS, GET_MODE (ivts->base_var),
> ivts->base_var, incr);
> }