This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][AArch64] Implement ALU_BRANCH fusion
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- Cc: "Naveen dot Hurugalawadi at cavium dot com" <Naveen dot Hurugalawadi at cavium dot com>, "Andrew dot pinski at cavium dot com" <Andrew dot pinski at cavium dot com>, Kyrylo Tkachov <Kyrylo dot Tkachov at arm dot com>, James Greenhalgh <James dot Greenhalgh at arm dot com>, nd <nd at arm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 20 Mar 2017 22:37:13 -0700
- Subject: Re: [PATCH][AArch64] Implement ALU_BRANCH fusion
- Authentication-results: sourceware.org; auth=none
- References: <VI1PR0802MB26218E2C0940948518A0571783210@VI1PR0802MB2621.eurprd08.prod.outlook.com> <DB6PR0802MB2615C7C0031757AEE914E4C183270@DB6PR0802MB2615.eurprd08.prod.outlook.com>
On Wed, Mar 15, 2017 at 8:20 AM, Wilco Dijkstra <Wilco.Dijkstra@arm.com> wrote:
> Hi,
>
> I think the patch isn't quite complete yet. You will also need changes in
> generic code. Currently sched_macro_fuse_insns() does:
>
> if (any_condjump_p (insn))
> {
> unsigned int condreg1, condreg2;
> rtx cc_reg_1;
> targetm.fixed_condition_code_regs (&condreg1, &condreg2);
> cc_reg_1 = gen_rtx_REG (CCmode, condreg1);
> prev = prev_nonnote_nondebug_insn (insn);
> if (!reg_referenced_p (cc_reg_1, PATTERN (insn))
> || !prev
> || !modified_in_p (cc_reg_1, prev))
> return;
> }
>
> Ie. it explicitly looks for a flag-setting ALU instruction whose condition is
> used by a conditional branch, so none of the cases in your patch can match.
>
> Note this code also excludes all CBZ type branches as fusion candidates,
> is that intended too?
It is not intended that way; I did not even notice it after the
previous changes to make the macro_fusion more generic. I wonder how
this code ever worked for the folks before we started to touch it :).
Naveen,
Basically the idea is to push the check for CC usage into the target
macros (macro_fusion_pair_p in i386.c and aarch64.c are the only usage
of compare/branch fusion) instead of keeping it in the general code.
Also in aarch64.c's macro fusion you need check that the branch
instruction uses the same register as the other instruction sets like
the other code in this area.
Thanks,
Andrew Pinski
>
> Wilco