This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: Support IA-64 speculation [3/5]


The patch is ok. Just please change names

find_more_rgns -> extend_rgns
PARAM_MAX_SCHED_MORE_REGIONS_ITERS -> PARAM_MAX_SCHED_EXTEND_REGION_ITERS
max-sched-more-regions-iters -> max-sched-extend-region-iters
header_more -> extended_rgn_header
more_regions_p -> extend_regions_p

Other changes becuase of the name changes are below.

2006-02-11 Maxim Kuvyrkov <mkuvyrkov@ispras.ru>

	* sched-rgn.c (find_more_rgns): New static function.
	(find_rgns): Use it.
	(gather_region_statistics, print_region_statistics): New static
	functions.
	* params.def (PARAM_MAX_SCHED_MORE_REGIONS_ITERS): New parameter.
      * invoke.texi (max-sched-more-regions-iters): Document.


Index: doc/invoke.texi
===================================================================
--- doc/invoke.texi (.../sched-deps/gcc) (revision 2383)
+++ doc/invoke.texi (.../regions/gcc) (revision 2383)
@@ -6180,6 +6180,12 @@ interblock scheduling. The default valu
The minimum probability (in percents) of reaching a source block
for interblock speculative scheduling. The default value is 40.
+@item max-sched-more-regions-iters
+The maximum number of iterations through CFG to find more regions.
extend regions.
+0 - disable forming of more regions,

disable extension of regions. ...

Index: sched-rgn.c
===================================================================
--- sched-rgn.c	(.../sched-deps/gcc)	(revision 2383)
+++ sched-rgn.c	(.../regions/gcc)	(revision 2383)

...


+/* Print regions statistics. S1 and S2 denote the data before and after + calling find_more_rgns, respectively. */
+static void
+print_region_statistics (int *s1, int s1_sz, int *s2, int s2_sz)
+{
+ int i;
+ + /* We iterate until s2_sz because find_more_rgns does not decrease + the maximal region size. */
+ for (i = 1; i < s2_sz; i++)
+ {
+ int n1, n2;
+
+ n2 = s2[i];
+
+ if (n2 == 0)
+ continue;
+
+ if (i >= s1_sz)
+ n1 = 0;
+ else
+ n1 = s1[i];
+
+ fprintf (sched_dump, ";; More regions statistics: size %d: was %d + %d more\n",
^ Extended regions statistics

+	       i + 1, n1, n2 - n1);
+    }
+}
+
+/* Find more non-trivial regions.

Extend regions.


+   DEGREE - Array of incoming edge count, considering only
+   the edges, that don't have their sources in formed regions yet.
+   IDXP - pointer to the next available index in rgn_bb_table.
+   HEADER - set of all region heads.
+   LOOP_HDR - mapping from block to the containing loop
+   (two blocks can reside within one region if they have
+   the same loop header).  */

...


+ /* Statistics were gathered on the SPEC2000 package of tests with
+ mainline weekly snapshot gcc-4.1-20051015 on ia64.
+ + Statistics for SPECint:
+ 1 iteration : 1751 cases (38.7%)
+ 2 iterations: 2770 cases (61.3%)
+ Blocks wrapped in regions by find_rgns: 18295 blocks
^ without the extension
+ Blocks wrapped in regions by find_more_rgns: 23821 blocks
--------------2 iterations in extend_rgns

+ (We don't count single block regions here).
+ + Statistics for SPECfp:
+ 1 iteration : 621 cases (35.9%)
+ 2 iterations: 1110 cases (64.1%)
+ Blocks wrapped in regions by find_rgns: 6476 blocks
^ without the extension
+ Blocks wrapped in regions by find_more_rgns: 11155 blocks
--------------2 iterations in extend_rgns
+     (We don't count single block regions here).
+
+     By default we do at most 2 iterations.
+     This can be overriden with max-sched-more-regions-iters parameter:
+     0 - disable forming of more regions,
----------------------- region extension
+ N > 0 - do at most N iterations. */
+ + if (sched_verbose && iter != 0)
+ fprintf (sched_dump, ";; More regions iterations: %d%s\n", iter,
----------------------Region extnsion iterations
+ rescan ? "... failed" : "");

...


Index: params.def
===================================================================
--- params.def (.../sched-deps/gcc) (revision 2383)
+++ params.def (.../regions/gcc) (revision 2383)
@@ -499,6 +499,11 @@ DEFPARAM(PARAM_MIN_SPEC_PROB,
"The minimum probability of reaching a source block for interblock speculative scheduling",
40, 0, 0)
+DEFPARAM(PARAM_MAX_SCHED_MORE_REGIONS_ITERS,
+ "max-sched-more-regions-iters",
+ "The maximum number of iterations through CFG to find more regions",
--------- extend
+         2, 0, 0)
+
 DEFPARAM(PARAM_MAX_LAST_VALUE_RTL,
 	 "max-last-value-rtl",
 	 "The maximum number of RTL nodes that can be recorded as combiner's last value",



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]