re PR rtl-optimization/64317 (Ineffective allocation of PIC base register)
authorVladimir Makarov <vmakarov@redhat.com>
Fri, 27 Feb 2015 22:02:05 +0000 (22:02 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Fri, 27 Feb 2015 22:02:05 +0000 (22:02 +0000)
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: Include "params.h".
(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.

From-SVN: r221070

gcc/ChangeLog
gcc/doc/invoke.texi
gcc/lra-constraints.c
gcc/params.def
gcc/params.h

index 0fe78df4fd2a304d14327de0370e384355ec8448..766556bf190800e08907bafb7ef90e54b2ff9fbe 100644 (file)
@@ -1,3 +1,16 @@
+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: Include "params.h".
+       (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.
+
 2015-02-27  Martin Liska  <mliska@suse.cz>
 
        * ipa-icf.h (struct symbol_compare_hashmap_traits): Add missing
index b07eed0f6e5f949843d5b10300b2358cefb9d566..a87376e1cbb7255a2c36eb746a6d1d4fda15859c 100644 (file)
@@ -10570,6 +10570,14 @@ by this parameter.  The default value of the parameter is 2, which is
 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
index 827c453b0fb111c866f79386f6f8b98ad00275e6..0ddd842deea7fbf3205de29b762f5ae0cf0ff1d6 100644 (file)
 #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 *tail)
 /* 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 4d3b398259294d2ebd357e10f5a1c0d53d7f6ebb..905c9e2679252881ae84dac59e38bdf6980a7b13 100644 (file)
@@ -836,6 +836,11 @@ DEFPARAM (PARAM_LRA_MAX_CONSIDERED_RELOAD_PSEUDOS,
          "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 2e50ff474c24c8ca91fcf9f25175281e1d089d0e..28d077f5b1b1963c505b06210f4abf381d76a827 100644 (file)
@@ -202,6 +202,8 @@ extern void init_param_values (int *params);
   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 \