This is the mail archive of the
mailing list for the GCC project.
Re: [RFC] Cse reducing performance of register allocation with -O2
- From: Jeff Law <law at redhat dot com>
- To: Vladimir Makarov <vmakarov at redhat dot com>, gcc at gcc dot gnu dot org, Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>, Ulrich Weigand <Ulrich dot Weigand at de dot ibm dot com>
- Date: Wed, 14 Oct 2015 09:41:58 -0600
- Subject: Re: [RFC] Cse reducing performance of register allocation with -O2
- Authentication-results: sourceware.org; auth=none
- References: <20151013131230 dot GA30317 at linux dot vnet dot ibm dot com> <561D3A28 dot 9090407 at redhat dot com> <561D71A8 dot 5010300 at redhat dot com>
On 10/13/2015 03:03 PM, Vladimir Makarov wrote:
I checked my article
and GVN gave mostly 0.2% on eon only. The current environment is quite
different (IRA, LRA) so the results might be different too.
Yea, but if anything I'd expect it's even less important now.
Interestingly enough if you go back far enough, the costing model was
supposed to prefer fixed hard regs, pseudos, then non-fixed hard
registers. That came from CHEAP_REGNO.
Also as I remember I implemented GVN only for pseudos.
LRA also checks values too but again only for reload and original pseudos.
It is a known problem. I saw many times when optimizations propagate
hard registers and it is truly hurts RA. I guess such practice should
be discouraged. RA can perfectly remove copy between hard reg and the
pseudo itself as in the example above by assigning the same hard reg to
At some point that ordering got lost and we have:
#define CHEAP_REGNO(N) \
(REGNO_PTR_FRAME_P (N) \
|| (HARD_REGISTER_NUM_P (N) \
&& FIXED_REGNO_P (N) && REGNO_REG_CLASS (N) != NO_REGS))
Which would appear to make pseudos & non-fixed hard registers be same
WRT CHEAP_REGNO -- punting to rtx_cost for both, presumably.