This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: FW: patch to fix PR21617
- From: Vladimir Makarov <vmakarov at redhat dot com>
- To: "Zamyatin, Igor" <igor dot zamyatin at intel dot com>
- Cc: Igor Zamyatin <izamyatin at gmail dot com>, "enkovich dot gnu at gmail dot com" <enkovich dot gnu at gmail dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 20 Jan 2012 13:13:37 -0500
- Subject: Re: FW: patch to fix PR21617
- References: <0EFAB2BDD0F67E4FB6CCC8B9F87D75690EC81F@IRSMSX101.ger.corp.intel.com> <CAKdSQZ=LeGPTAhHLRNLyxvVCgn4FhQsC60XeS=yO-SQo+a4tLQ@mail.gmail.com> <4F0C78FD.8050104@redhat.com> <0EFAB2BDD0F67E4FB6CCC8B9F87D756910D3FD@IRSMSX101.ger.corp.intel.com> <4F1882A9.2090408@redhat.com>
On 01/19/2012 03:52 PM, Vladimir Makarov wrote:
On 01/18/2012 02:30 PM, Zamyatin, Igor wrote:
Yes, we use Atom for EEMBC measurements.
We'll be glad to help you with your findings.
Thanks.
Unfortunately I tried several alternative patches but I did not find a
better solution (it is mostly code size degradation on CoreI7). Now I
am even thinking that the best action would have been ignoring the
original PR.
Could you try the attached patch. It might work.
I've tried several approach to prevent small hole creation in
ira-color.c::assign_hard_reg but it does not work well.
Thanks.
Index: ira-color.c
===================================================================
--- ira-color.c (revision 183312)
+++ ira-color.c (working copy)
@@ -1798,16 +1798,16 @@ bucket_allocno_compare_func (const void
int diff, a1_freq, a2_freq, a1_num, a2_num;
int cl1 = ALLOCNO_CLASS (a1), cl2 = ALLOCNO_CLASS (a2);
- /* Push pseudos requiring less hard registers first. It means that
- we will assign pseudos requiring more hard registers first
- avoiding creation small holes in free hard register file into
- which the pseudos requiring more hard registers can not fit. */
- if ((diff = (ira_reg_class_max_nregs[cl1][ALLOCNO_MODE (a1)]
- - ira_reg_class_max_nregs[cl2][ALLOCNO_MODE (a2)])) != 0)
- return diff;
a1_freq = ALLOCNO_FREQ (a1);
a2_freq = ALLOCNO_FREQ (a2);
- if ((diff = a1_freq - a2_freq) != 0)
+ /* Prefer to push pseudos requiring less hard registers first. It
+ means that we will assign pseudos requiring more hard registers
+ first avoiding creation small holes in free hard register file
+ into which the pseudos requiring more hard registers can not
+ fit. */
+ if ((diff = (a1_freq * ira_reg_class_max_nregs[cl1][ALLOCNO_MODE (a1)]
+ - a2_freq * ira_reg_class_max_nregs[cl2][ALLOCNO_MODE (a2)]))
+ != 0)
return diff;
a1_num = ALLOCNO_COLOR_DATA (a1)->available_regs_num;
a2_num = ALLOCNO_COLOR_DATA (a2)->available_regs_num;