* one more patch for PR64317
@ 2015-02-27 22:30 Vladimir Makarov
2015-02-27 23:26 ` Bernhard Reutner-Fischer
2015-02-28 1:43 ` Sandra Loosemore
0 siblings, 2 replies; 5+ messages in thread
From: Vladimir Makarov @ 2015-02-27 22:30 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 1039 bytes --]
The following patch improves inheritance for PR64317 testcase
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64317
I ran a lot SPEC2000 benchmarks to get better default parameter value
for EBB_PROBABILITY_CUTOFF in LRA inheritance. The new default parameter
value improves SPECInt2000 by 0.4% on x86-64 without changing SPECFP2000
rate. The code size changes are insignificant (0.002% increase for
SPECInt and 0.01% decrease for SPECFP).
The patch was bootstrapped and tested on x86-64.
Committed as rev.221070.
2015-02-27 Vladimir Makarov <vmakarov@redhat.com>
PR target/64317
* params.def (PARAM_LRA_INHERITANCE_EBB_PROBABILITY_CUTOFF): New.
* params.h (LRA_INHERITANCE_EBB_PROBABILITY_CUTOFF): New.
* lra-constraints.c (EBB_PROBABILITY_CUTOFF): Use
LRA_INHERITANCE_EBB_PROBABILITY_CUTOFF.
(lra_inheritance): Use '<' instead of '<=' for
EBB_PROBABILITY_CUTOFF.
* doc/invoke.texi (lra-inheritance-ebb-probability-cutoff):
Document change.
[-- Attachment #2: pr64317-2.patch --]
[-- Type: text/plain, Size: 3364 bytes --]
Index: params.def
===================================================================
--- params.def (revision 220916)
+++ params.def (working copy)
@@ -836,6 +836,11 @@ DEFPARAM (PARAM_LRA_MAX_CONSIDERED_RELOA
"The max number of reload pseudos which are considered during spilling a non-reload pseudo",
500, 0, 0)
+DEFPARAM (PARAM_LRA_INHERITANCE_EBB_PROBABILITY_CUTOFF,
+ "lra-inheritance-ebb-probability-cutoff",
+ "Minimal fall-through edge probability in percentage used to add BB to inheritance EEB in LRA",
+ 40, 0, 100)
+
/* Switch initialization conversion will refuse to create arrays that are
bigger than this parameter times the number of switch branches. */
Index: params.h
===================================================================
--- params.h (revision 220916)
+++ params.h (working copy)
@@ -202,6 +202,8 @@ extern void init_param_values (int *para
PARAM_VALUE (PARAM_IRA_LOOP_RESERVED_REGS)
#define LRA_MAX_CONSIDERED_RELOAD_PSEUDOS \
PARAM_VALUE (PARAM_LRA_MAX_CONSIDERED_RELOAD_PSEUDOS)
+#define LRA_INHERITANCE_EBB_PROBABILITY_CUTOFF \
+ PARAM_VALUE (PARAM_LRA_INHERITANCE_EBB_PROBABILITY_CUTOFF)
#define SWITCH_CONVERSION_BRANCH_RATIO \
PARAM_VALUE (PARAM_SWITCH_CONVERSION_BRANCH_RATIO)
#define LOOP_INVARIANT_MAX_BBS_IN_LOOP \
Index: lra-constraints.c
===================================================================
--- lra-constraints.c (revision 220916)
+++ lra-constraints.c (working copy)
@@ -154,6 +154,7 @@
#include "df.h"
#include "ira.h"
#include "rtl-error.h"
+#include "params.h"
#include "lra-int.h"
/* Value of LRA_CURR_RELOAD_NUM at the beginning of BB of the current
@@ -5694,7 +5695,8 @@ inherit_in_ebb (rtx_insn *head, rtx_insn
/* This value affects EBB forming. If probability of edge from EBB to
a BB is not greater than the following value, we don't add the BB
to EBB. */
-#define EBB_PROBABILITY_CUTOFF ((REG_BR_PROB_BASE * 50) / 100)
+#define EBB_PROBABILITY_CUTOFF \
+ ((REG_BR_PROB_BASE * LRA_INHERITANCE_EBB_PROBABILITY_CUTOFF) / 100)
/* Current number of inheritance/split iteration. */
int lra_inheritance_iter;
@@ -5740,7 +5742,7 @@ lra_inheritance (void)
e = find_fallthru_edge (bb->succs);
if (! e)
break;
- if (e->probability <= EBB_PROBABILITY_CUTOFF)
+ if (e->probability < EBB_PROBABILITY_CUTOFF)
break;
bb = bb->next_bb;
}
Index: doc/invoke.texi
===================================================================
--- doc/invoke.texi (revision 220916)
+++ doc/invoke.texi (working copy)
@@ -10570,6 +10570,14 @@ by this parameter. The default value of
the minimal number of registers needed by typical instructions.
This value is the best found from numerous experiments.
+@item lra-inheritance-ebb-probability-cutoff
+LRA tries to reuse values reloaded in registers in subsequent insns.
+This optimization is called inheritance. EBB is used as a region to
+do this optimization. The parameter defines a minimal fall-through
+edge probability in percentage used to add BB to inheritance EBB in
+LRA. The default value of the parameter is 40. The value was chosen
+from numerous runs of SPEC2000 on x86-64.
+
@item loop-invariant-max-bbs-in-loop
Loop invariant motion can be very expensive, both in compilation time and
in amount of needed compile-time memory, with very large loops. Loops
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: one more patch for PR64317
2015-02-27 22:30 one more patch for PR64317 Vladimir Makarov
@ 2015-02-27 23:26 ` Bernhard Reutner-Fischer
2015-02-28 0:54 ` Vladimir Makarov
2015-02-28 1:43 ` Sandra Loosemore
1 sibling, 1 reply; 5+ messages in thread
From: Bernhard Reutner-Fischer @ 2015-02-27 23:26 UTC (permalink / raw)
To: Vladimir Makarov, gcc-patches
On February 27, 2015 11:03:14 PM GMT+01:00, Vladimir Makarov <vmakarov@redhat.com> wrote:
> The following patch improves inheritance for PR64317 testcase
>
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64317
>
> I ran a lot SPEC2000 benchmarks to get better default parameter value
>for EBB_PROBABILITY_CUTOFF in LRA inheritance. The new default
>parameter
>value improves SPECInt2000 by 0.4% on x86-64 without changing
>SPECFP2000
>rate. The code size changes are insignificant (0.002% increase for
>SPECInt and 0.01% decrease for SPECFP).
>
>The patch was bootstrapped and tested on x86-64.
>
>Committed as rev.221070.
+DEFPARAM (PARAM_LRA_INHERITANCE_EBB_PROBABILITY_CUTOFF,
+ "lra-inheritance-ebb-probability-cutoff",
+ "Minimal fall-through edge probability in percentage used to add BB to inheritance EEB in LRA",
+ 40, 0, 100)
s/EEB/EBB/
?
Thanks,
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: one more patch for PR64317
2015-02-27 23:26 ` Bernhard Reutner-Fischer
@ 2015-02-28 0:54 ` Vladimir Makarov
0 siblings, 0 replies; 5+ messages in thread
From: Vladimir Makarov @ 2015-02-28 0:54 UTC (permalink / raw)
To: Bernhard Reutner-Fischer, gcc-patches
On 2015-02-27 5:30 PM, Bernhard Reutner-Fischer wrote:
> On February 27, 2015 11:03:14 PM GMT+01:00, Vladimir Makarov <vmakarov@redhat.com> wrote:
>> Committed as rev.221070.
>
> +DEFPARAM (PARAM_LRA_INHERITANCE_EBB_PROBABILITY_CUTOFF,
> + "lra-inheritance-ebb-probability-cutoff",
> + "Minimal fall-through edge probability in percentage used to add BB to inheritance EEB in LRA",
> + 40, 0, 100)
>
> s/EEB/EBB/
>
>
Fixed. Thanks for pointing this out.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: one more patch for PR64317
2015-02-27 22:30 one more patch for PR64317 Vladimir Makarov
2015-02-27 23:26 ` Bernhard Reutner-Fischer
@ 2015-02-28 1:43 ` Sandra Loosemore
2015-02-28 8:39 ` Vladimir Makarov
1 sibling, 1 reply; 5+ messages in thread
From: Sandra Loosemore @ 2015-02-28 1:43 UTC (permalink / raw)
To: Vladimir Makarov; +Cc: gcc-patches
On 02/27/2015 03:03 PM, Vladimir Makarov wrote:
> The following patch improves inheritance for PR64317 testcase
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64317
>
> [snip]
> Index: params.def
> ===================================================================
> --- params.def (revision 220916)
> +++ params.def (working copy)
> @@ -836,6 +836,11 @@ DEFPARAM (PARAM_LRA_MAX_CONSIDERED_RELOA
> "The max number of reload pseudos which are considered during spilling a non-reload pseudo",
> 500, 0, 0)
>
> +DEFPARAM (PARAM_LRA_INHERITANCE_EBB_PROBABILITY_CUTOFF,
> + "lra-inheritance-ebb-probability-cutoff",
> + "Minimal fall-through edge probability in percentage used to add BB to inheritance EEB in LRA",
s/EEB/EBB/?
I can't say I understand what either of those abbreviations means....
-Sandra
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: one more patch for PR64317
2015-02-28 1:43 ` Sandra Loosemore
@ 2015-02-28 8:39 ` Vladimir Makarov
0 siblings, 0 replies; 5+ messages in thread
From: Vladimir Makarov @ 2015-02-28 8:39 UTC (permalink / raw)
To: Sandra Loosemore; +Cc: gcc-patches
On 2015-02-27 8:06 PM, Sandra Loosemore wrote:
> On 02/27/2015 03:03 PM, Vladimir Makarov wrote:
>> The following patch improves inheritance for PR64317 testcase
>>
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64317
>>
>> [snip]
>> Index: params.def
>> ===================================================================
>> --- params.def (revision 220916)
>> +++ params.def (working copy)
>> @@ -836,6 +836,11 @@ DEFPARAM (PARAM_LRA_MAX_CONSIDERED_RELOA
>> "The max number of reload pseudos which are considered during
>> spilling a non-reload pseudo",
>> 500, 0, 0)
>>
>> +DEFPARAM (PARAM_LRA_INHERITANCE_EBB_PROBABILITY_CUTOFF,
>> + "lra-inheritance-ebb-probability-cutoff",
>> + "Minimal fall-through edge probability in percentage used to
>> add BB to inheritance EEB in LRA",
>
> s/EEB/EBB/?
>
> I can't say I understand what either of those abbreviations means....
>
EBB is an extended basic block.
EEB is a typo.
Sorry for using the abbreviation but it is a way to keep attribute name
shorter (although it is already too long).
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-02-28 1:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-27 22:30 one more patch for PR64317 Vladimir Makarov
2015-02-27 23:26 ` Bernhard Reutner-Fischer
2015-02-28 0:54 ` Vladimir Makarov
2015-02-28 1:43 ` Sandra Loosemore
2015-02-28 8:39 ` Vladimir Makarov
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).