[RFA] Restore combine.c split point for multiply-accumulate instructions
Segher Boessenkool
segher@kernel.crashing.org
Thu May 21 13:44:00 GMT 2015
On Wed, May 20, 2015 at 11:38:44PM -0600, Jeff Law wrote:
> I've also verified this is one of the changes ultimately necessary to
> resolve the code generation regressions caused by Venkat's combine.c
> change on the PA across my 300+ testfiles for a PA cross compiler.
How much does it help, do you know?
> OK for the trunk?
Yes, please commit. Thanks. (One tiny comment below).
Segher
> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
> index 490386e..250fa0a 100644
> --- a/gcc/ChangeLog
> +++ b/gcc/ChangeLog
> @@ -1,5 +1,8 @@
> 2015-05-20 Jeff Law <law@redhat.com>
>
> + * combine.c (find_split_point): Handle ASHIFT like MULT to encourage
> + multiply-accumulate/shift-add insn generation.
> +
> * config/pa/pa.c (pa_print_operand): New 'o' output modifier.
> (pa_mem_shadd_constant_p): Renamed from pa_shadd_constant_p.
> (pa_shadd_constant_p): Allow constants for shadd insns rather
> diff --git a/gcc/combine.c b/gcc/combine.c
> index a90849e..ab6de3a 100644
> --- a/gcc/combine.c
> +++ b/gcc/combine.c
> @@ -5145,7 +5163,9 @@ find_split_point (rtx *loc, rtx_insn *insn, bool set_src)
> /* Split at a multiply-accumulate instruction. However if this is
> the SET_SRC, we likely do not have such an instruction and it's
> worthless to try this split. */
> - if (!set_src && GET_CODE (XEXP (x, 0)) == MULT)
> + if (!set_src
> + && (GET_CODE (XEXP (x, 0)) == MULT
> + || GET_CODE (XEXP (x, 0)) == ASHIFT))
> return loc;
It might be better to also check if it is shifting by a CONST_INT.
I doubt it matters much, but it is closer to the original.
Segher
More information about the Gcc-patches
mailing list