* PR88751: Backport to GCC 8 and 9 branches?
@ 2019-09-06 8:11 Andreas Krebbel
2019-09-06 10:48 ` Richard Biener
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Krebbel @ 2019-09-06 8:11 UTC (permalink / raw)
To: gcc-patches
Hi,
since this caused a critical performance regression in the OpenJ9 byte code interpreter after
migrating from GCC 4.8 to GCC 7 I would like to backport this patch also to GCC 8 and 9 branch.
Ok - after bootstrap and regression test went fine?
Andreas
commit d3dc20418aad41af83fe45ccba527deb0b334983
Author: krebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu Jun 6 11:35:04 2019 +0000
Fix PR88751
This patch implements a small improvement for the heuristic in lra
which decides when it has to activate the simpler register allocation
algorithm.
gcc/ChangeLog:
2019-06-06 Andreas Krebbel <krebbel@linux.ibm.com>
PR rtl-optimization/88751
* ira.c (ira): Use the number of the actually referenced registers
when calculating the threshold.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271996 138bc75d-0d04-0410-961f-82ee72b054a4
diff --git a/gcc/ira.c b/gcc/ira.c
index 4a14fb31583..725636d8dc5 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -5198,6 +5198,8 @@ ira (FILE *f)
int ira_max_point_before_emit;
bool saved_flag_caller_saves = flag_caller_saves;
enum ira_region saved_flag_ira_region = flag_ira_region;
+ unsigned int i;
+ int num_used_regs = 0;
clear_bb_flags ();
@@ -5213,12 +5215,17 @@ ira (FILE *f)
ira_conflicts_p = optimize > 0;
+ /* Determine the number of pseudos actually requiring coloring. */
+ for (i = FIRST_PSEUDO_REGISTER; i < DF_REG_SIZE (df); i++)
+ num_used_regs += !!(DF_REG_USE_COUNT (i) + DF_REG_DEF_COUNT (i));
+
/* If there are too many pseudos and/or basic blocks (e.g. 10K
pseudos and 10K blocks or 100K pseudos and 1K blocks), we will
use simplified and faster algorithms in LRA. */
lra_simple_p
= (ira_use_lra_p
- && max_reg_num () >= (1 << 26) / last_basic_block_for_fn (cfun));
+ && num_used_regs >= (1 << 26) / last_basic_block_for_fn (cfun));
+
if (lra_simple_p)
{
/* It permits to skip live range splitting in LRA. */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PR88751: Backport to GCC 8 and 9 branches?
2019-09-06 8:11 PR88751: Backport to GCC 8 and 9 branches? Andreas Krebbel
@ 2019-09-06 10:48 ` Richard Biener
2019-09-20 9:28 ` Andreas Krebbel
0 siblings, 1 reply; 4+ messages in thread
From: Richard Biener @ 2019-09-06 10:48 UTC (permalink / raw)
To: Andreas Krebbel; +Cc: GCC Patches
On Fri, Sep 6, 2019 at 10:11 AM Andreas Krebbel <krebbel@linux.ibm.com> wrote:
>
> Hi,
>
> since this caused a critical performance regression in the OpenJ9 byte code interpreter after
> migrating from GCC 4.8 to GCC 7 I would like to backport this patch also to GCC 8 and 9 branch.
>
> Ok - after bootstrap and regression test went fine?
Looks reasonable to me. But what about GCC 7? I assume you also verified the
actual performance regression is gone.
Richard.
>
> Andreas
>
>
> commit d3dc20418aad41af83fe45ccba527deb0b334983
> Author: krebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>
> Date: Thu Jun 6 11:35:04 2019 +0000
>
> Fix PR88751
>
> This patch implements a small improvement for the heuristic in lra
> which decides when it has to activate the simpler register allocation
> algorithm.
>
> gcc/ChangeLog:
>
> 2019-06-06 Andreas Krebbel <krebbel@linux.ibm.com>
>
> PR rtl-optimization/88751
> * ira.c (ira): Use the number of the actually referenced registers
> when calculating the threshold.
>
>
>
> git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271996 138bc75d-0d04-0410-961f-82ee72b054a4
>
>
> diff --git a/gcc/ira.c b/gcc/ira.c
> index 4a14fb31583..725636d8dc5 100644
> --- a/gcc/ira.c
> +++ b/gcc/ira.c
> @@ -5198,6 +5198,8 @@ ira (FILE *f)
> int ira_max_point_before_emit;
> bool saved_flag_caller_saves = flag_caller_saves;
> enum ira_region saved_flag_ira_region = flag_ira_region;
> + unsigned int i;
> + int num_used_regs = 0;
>
> clear_bb_flags ();
>
> @@ -5213,12 +5215,17 @@ ira (FILE *f)
>
> ira_conflicts_p = optimize > 0;
>
> + /* Determine the number of pseudos actually requiring coloring. */
> + for (i = FIRST_PSEUDO_REGISTER; i < DF_REG_SIZE (df); i++)
> + num_used_regs += !!(DF_REG_USE_COUNT (i) + DF_REG_DEF_COUNT (i));
> +
> /* If there are too many pseudos and/or basic blocks (e.g. 10K
> pseudos and 10K blocks or 100K pseudos and 1K blocks), we will
> use simplified and faster algorithms in LRA. */
> lra_simple_p
> = (ira_use_lra_p
> - && max_reg_num () >= (1 << 26) / last_basic_block_for_fn (cfun));
> + && num_used_regs >= (1 << 26) / last_basic_block_for_fn (cfun));
> +
> if (lra_simple_p)
> {
> /* It permits to skip live range splitting in LRA. */
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PR88751: Backport to GCC 8 and 9 branches?
2019-09-06 10:48 ` Richard Biener
@ 2019-09-20 9:28 ` Andreas Krebbel
2019-09-20 12:02 ` Richard Biener
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Krebbel @ 2019-09-20 9:28 UTC (permalink / raw)
To: Richard Biener; +Cc: GCC Patches, jakub
On 06.09.19 12:48, Richard Biener wrote:
> On Fri, Sep 6, 2019 at 10:11 AM Andreas Krebbel <krebbel@linux.ibm.com> wrote:
>>
>> Hi,
>>
>> since this caused a critical performance regression in the OpenJ9 byte code interpreter after
>> migrating from GCC 4.8 to GCC 7 I would like to backport this patch also to GCC 8 and 9 branch.
>>
>> Ok - after bootstrap and regression test went fine?
>
> Looks reasonable to me. But what about GCC 7? I assume you also verified the
> actual performance regression is gone.
I've committed the patch to GCC 7 and 8 branch after verifying that the change has the desired
effect on the source code file from OpenJ9.
GCC 9 branch is currently frozen. Ok, to apply there as well?
Andreas
>
> Richard.
>
>>
>> Andreas
>>
>>
>> commit d3dc20418aad41af83fe45ccba527deb0b334983
>> Author: krebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>
>> Date: Thu Jun 6 11:35:04 2019 +0000
>>
>> Fix PR88751
>>
>> This patch implements a small improvement for the heuristic in lra
>> which decides when it has to activate the simpler register allocation
>> algorithm.
>>
>> gcc/ChangeLog:
>>
>> 2019-06-06 Andreas Krebbel <krebbel@linux.ibm.com>
>>
>> PR rtl-optimization/88751
>> * ira.c (ira): Use the number of the actually referenced registers
>> when calculating the threshold.
>>
>>
>>
>> git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271996 138bc75d-0d04-0410-961f-82ee72b054a4
>>
>>
>> diff --git a/gcc/ira.c b/gcc/ira.c
>> index 4a14fb31583..725636d8dc5 100644
>> --- a/gcc/ira.c
>> +++ b/gcc/ira.c
>> @@ -5198,6 +5198,8 @@ ira (FILE *f)
>> int ira_max_point_before_emit;
>> bool saved_flag_caller_saves = flag_caller_saves;
>> enum ira_region saved_flag_ira_region = flag_ira_region;
>> + unsigned int i;
>> + int num_used_regs = 0;
>>
>> clear_bb_flags ();
>>
>> @@ -5213,12 +5215,17 @@ ira (FILE *f)
>>
>> ira_conflicts_p = optimize > 0;
>>
>> + /* Determine the number of pseudos actually requiring coloring. */
>> + for (i = FIRST_PSEUDO_REGISTER; i < DF_REG_SIZE (df); i++)
>> + num_used_regs += !!(DF_REG_USE_COUNT (i) + DF_REG_DEF_COUNT (i));
>> +
>> /* If there are too many pseudos and/or basic blocks (e.g. 10K
>> pseudos and 10K blocks or 100K pseudos and 1K blocks), we will
>> use simplified and faster algorithms in LRA. */
>> lra_simple_p
>> = (ira_use_lra_p
>> - && max_reg_num () >= (1 << 26) / last_basic_block_for_fn (cfun));
>> + && num_used_regs >= (1 << 26) / last_basic_block_for_fn (cfun));
>> +
>> if (lra_simple_p)
>> {
>> /* It permits to skip live range splitting in LRA. */
>>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PR88751: Backport to GCC 8 and 9 branches?
2019-09-20 9:28 ` Andreas Krebbel
@ 2019-09-20 12:02 ` Richard Biener
0 siblings, 0 replies; 4+ messages in thread
From: Richard Biener @ 2019-09-20 12:02 UTC (permalink / raw)
To: Andreas Krebbel; +Cc: GCC Patches, jakub
On Fri, Sep 20, 2019 at 11:28 AM Andreas Krebbel <krebbel@linux.ibm.com> wrote:
>
> On 06.09.19 12:48, Richard Biener wrote:
> > On Fri, Sep 6, 2019 at 10:11 AM Andreas Krebbel <krebbel@linux.ibm.com> wrote:
> >>
> >> Hi,
> >>
> >> since this caused a critical performance regression in the OpenJ9 byte code interpreter after
> >> migrating from GCC 4.8 to GCC 7 I would like to backport this patch also to GCC 8 and 9 branch.
> >>
> >> Ok - after bootstrap and regression test went fine?
> >
> > Looks reasonable to me. But what about GCC 7? I assume you also verified the
> > actual performance regression is gone.
>
> I've committed the patch to GCC 7 and 8 branch after verifying that the change has the desired
> effect on the source code file from OpenJ9.
>
> GCC 9 branch is currently frozen. Ok, to apply there as well?
Yes, it shouldn't be frozen anymore...
Richard.
> Andreas
>
> >
> > Richard.
> >
> >>
> >> Andreas
> >>
> >>
> >> commit d3dc20418aad41af83fe45ccba527deb0b334983
> >> Author: krebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>
> >> Date: Thu Jun 6 11:35:04 2019 +0000
> >>
> >> Fix PR88751
> >>
> >> This patch implements a small improvement for the heuristic in lra
> >> which decides when it has to activate the simpler register allocation
> >> algorithm.
> >>
> >> gcc/ChangeLog:
> >>
> >> 2019-06-06 Andreas Krebbel <krebbel@linux.ibm.com>
> >>
> >> PR rtl-optimization/88751
> >> * ira.c (ira): Use the number of the actually referenced registers
> >> when calculating the threshold.
> >>
> >>
> >>
> >> git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271996 138bc75d-0d04-0410-961f-82ee72b054a4
> >>
> >>
> >> diff --git a/gcc/ira.c b/gcc/ira.c
> >> index 4a14fb31583..725636d8dc5 100644
> >> --- a/gcc/ira.c
> >> +++ b/gcc/ira.c
> >> @@ -5198,6 +5198,8 @@ ira (FILE *f)
> >> int ira_max_point_before_emit;
> >> bool saved_flag_caller_saves = flag_caller_saves;
> >> enum ira_region saved_flag_ira_region = flag_ira_region;
> >> + unsigned int i;
> >> + int num_used_regs = 0;
> >>
> >> clear_bb_flags ();
> >>
> >> @@ -5213,12 +5215,17 @@ ira (FILE *f)
> >>
> >> ira_conflicts_p = optimize > 0;
> >>
> >> + /* Determine the number of pseudos actually requiring coloring. */
> >> + for (i = FIRST_PSEUDO_REGISTER; i < DF_REG_SIZE (df); i++)
> >> + num_used_regs += !!(DF_REG_USE_COUNT (i) + DF_REG_DEF_COUNT (i));
> >> +
> >> /* If there are too many pseudos and/or basic blocks (e.g. 10K
> >> pseudos and 10K blocks or 100K pseudos and 1K blocks), we will
> >> use simplified and faster algorithms in LRA. */
> >> lra_simple_p
> >> = (ira_use_lra_p
> >> - && max_reg_num () >= (1 << 26) / last_basic_block_for_fn (cfun));
> >> + && num_used_regs >= (1 << 26) / last_basic_block_for_fn (cfun));
> >> +
> >> if (lra_simple_p)
> >> {
> >> /* It permits to skip live range splitting in LRA. */
> >>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-09-20 12:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 8:11 PR88751: Backport to GCC 8 and 9 branches? Andreas Krebbel
2019-09-06 10:48 ` Richard Biener
2019-09-20 9:28 ` Andreas Krebbel
2019-09-20 12:02 ` Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).