Merge lp:~eres/gcc-linaro/sms_fix_row_rest_count into lp:gcc-linaro/4.5

Proposed by Revital Eres
Status: Merged
Approved by: Richard Sandiford
Approved revision: no longer in the source branch.
Merged at revision: 99522
Proposed branch: lp:~eres/gcc-linaro/sms_fix_row_rest_count
Merge into: lp:gcc-linaro/4.5
Diff against target: 215 lines (+60/-22)
2 files modified
ChangeLog.linaro (+15/-0)
gcc/modulo-sched.c (+45/-22)
To merge this branch: bzr merge lp:~eres/gcc-linaro/sms_fix_row_rest_count
Reviewer Review Type Date Requested Status
Richard Sandiford Approve
Review via email: mp+66778@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild has taken a snapshot of this branch at r99521 and queued it for build.

The snapshot is available at:
 http://ex.seabright.co.nz/snapshots/gcc-linaro-4.5+bzr99521~eres~sms_fix_row_rest_count.tar.xdelta3.xz

and will be built on the following builders:
 a9-builder armv5-builder i686 x86_64

You can track the build queue at:
 http://ex.seabright.co.nz/helpers/scheduler

cbuild-snapshot: gcc-linaro-4.5+bzr99521~eres~sms_fix_row_rest_count
cbuild-ancestor: lp:gcc-linaro+bzr99520
cbuild-state: check

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild successfully built this on armv7l-natty-cbuild148-ursa3-cortexa9r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99521~eres~sms_fix_row_rest_count/logs/armv7l-natty-cbuild148-ursa3-cortexa9r1

The test suite results were unchanged compared to the branch point lp:gcc-linaro+bzr99520.

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99521~eres~sms_fix_row_rest_count/logs/armv7l-natty-cbuild148-ursa3-cortexa9r1/gcc-testsuite.txt

cbuild-checked: armv7l-natty-cbuild148-ursa3-cortexa9r1

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild successfully built this on x86_64-natty-cbuild148-oort1-x86_64r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99521~eres~sms_fix_row_rest_count/logs/x86_64-natty-cbuild148-oort1-x86_64r1

The test suite results were unchanged compared to the branch point lp:gcc-linaro+bzr99520.

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99521~eres~sms_fix_row_rest_count/logs/x86_64-natty-cbuild148-oort1-x86_64r1/gcc-testsuite.txt

cbuild-checked: x86_64-natty-cbuild148-oort1-x86_64r1

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild successfully built this on armv7l-natty-cbuild149-ursa4-armv5r2.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99521~eres~sms_fix_row_rest_count/logs/armv7l-natty-cbuild149-ursa4-armv5r2

The test suite was not checked as the branch point lp:gcc-linaro+bzr99520 has nothing to compare against.

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99521~eres~sms_fix_row_rest_count/logs/armv7l-natty-cbuild149-ursa4-armv5r2/gcc-testsuite.txt

cbuild-checked: armv7l-natty-cbuild149-ursa4-armv5r2

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild successfully built this on i686-natty-cbuild151-oort2-i686r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99521~eres~sms_fix_row_rest_count/logs/i686-natty-cbuild151-oort2-i686r1

The test suite results were unchanged compared to the branch point lp:gcc-linaro+bzr99520.

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99521~eres~sms_fix_row_rest_count/logs/i686-natty-cbuild151-oort2-i686r1/gcc-testsuite.txt

cbuild-checked: i686-natty-cbuild151-oort2-i686r1

Revision history for this message
Richard Sandiford (rsandifo) wrote :

OK.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog.linaro'
--- ChangeLog.linaro 2011-07-04 10:55:55 +0000
+++ ChangeLog.linaro 2011-07-04 11:46:49 +0000
@@ -1,3 +1,18 @@
12011-07-04 Revital Eres <revital.eres@linaro.org>
2
3 * modulo-sched.c (struct ps_insn): Remove row_rest_count field.
4 (struct partial_schedule): Add rows_length field.
5 (verify_partial_schedule): Check rows_length.
6 (ps_insert_empty_row): Handle rows_length.
7 (create_partial_schedule): Likewise.
8 (free_partial_schedule): Likewise.
9 (reset_partial_schedule): Likewise.
10 (create_ps_insn): Remove rest_count argument.
11 (remove_node_from_ps): Update rows_length.
12 (add_node_to_ps): Update rows_length and call create_ps_insn
13 without passing row_rest_count.
14 (rotate_partial_schedule): Update rows_length.
15
12011-07-01 Andrew Stubbs <ams@codesourcery.com>162011-07-01 Andrew Stubbs <ams@codesourcery.com>
217
3 Merge from FSF 4.5 branch r175676 (pre 4.5.4).18 Merge from FSF 4.5 branch r175676 (pre 4.5.4).
419
=== modified file 'gcc/modulo-sched.c'
--- gcc/modulo-sched.c 2011-05-13 16:16:22 +0000
+++ gcc/modulo-sched.c 2011-07-04 11:46:49 +0000
@@ -134,8 +134,6 @@
134 ps_insn_ptr next_in_row,134 ps_insn_ptr next_in_row,
135 prev_in_row;135 prev_in_row;
136136
137 /* The number of nodes in the same row that come after this node. */
138 int row_rest_count;
139};137};
140138
141/* Holds the partial schedule as an array of II rows. Each entry of the139/* Holds the partial schedule as an array of II rows. Each entry of the
@@ -149,6 +147,12 @@
149 /* rows[i] points to linked list of insns scheduled in row i (0<=i<ii). */147 /* rows[i] points to linked list of insns scheduled in row i (0<=i<ii). */
150 ps_insn_ptr *rows;148 ps_insn_ptr *rows;
151149
150 /* rows_length[i] holds the number of instructions in the row.
151 It is used only (as an optimization) to back off quickly from
152 trying to schedule a node in a full row; that is, to avoid running
153 through futile DFA state transitions. */
154 int *rows_length;
155
152 /* The earliest absolute cycle of an insn in the partial schedule. */156 /* The earliest absolute cycle of an insn in the partial schedule. */
153 int min_cycle;157 int min_cycle;
154158
@@ -1907,6 +1911,7 @@
1907 int ii = ps->ii;1911 int ii = ps->ii;
1908 int new_ii = ii + 1;1912 int new_ii = ii + 1;
1909 int row;1913 int row;
1914 int *rows_length_new;
19101915
1911 verify_partial_schedule (ps, sched_nodes);1916 verify_partial_schedule (ps, sched_nodes);
19121917
@@ -1921,9 +1926,11 @@
1921 rotate_partial_schedule (ps, PS_MIN_CYCLE (ps));1926 rotate_partial_schedule (ps, PS_MIN_CYCLE (ps));
19221927
1923 rows_new = (ps_insn_ptr *) xcalloc (new_ii, sizeof (ps_insn_ptr));1928 rows_new = (ps_insn_ptr *) xcalloc (new_ii, sizeof (ps_insn_ptr));
1929 rows_length_new = (int *) xcalloc (new_ii, sizeof (int));
1924 for (row = 0; row < split_row; row++)1930 for (row = 0; row < split_row; row++)
1925 {1931 {
1926 rows_new[row] = ps->rows[row];1932 rows_new[row] = ps->rows[row];
1933 rows_length_new[row] = ps->rows_length[row];
1927 ps->rows[row] = NULL;1934 ps->rows[row] = NULL;
1928 for (crr_insn = rows_new[row];1935 for (crr_insn = rows_new[row];
1929 crr_insn; crr_insn = crr_insn->next_in_row)1936 crr_insn; crr_insn = crr_insn->next_in_row)
@@ -1944,6 +1951,7 @@
1944 for (row = split_row; row < ii; row++)1951 for (row = split_row; row < ii; row++)
1945 {1952 {
1946 rows_new[row + 1] = ps->rows[row];1953 rows_new[row + 1] = ps->rows[row];
1954 rows_length_new[row + 1] = ps->rows_length[row];
1947 ps->rows[row] = NULL;1955 ps->rows[row] = NULL;
1948 for (crr_insn = rows_new[row + 1];1956 for (crr_insn = rows_new[row + 1];
1949 crr_insn; crr_insn = crr_insn->next_in_row)1957 crr_insn; crr_insn = crr_insn->next_in_row)
@@ -1965,6 +1973,8 @@
1965 + (SMODULO (ps->max_cycle, ii) >= split_row ? 1 : 0);1973 + (SMODULO (ps->max_cycle, ii) >= split_row ? 1 : 0);
1966 free (ps->rows);1974 free (ps->rows);
1967 ps->rows = rows_new;1975 ps->rows = rows_new;
1976 free (ps->rows_length);
1977 ps->rows_length = rows_length_new;
1968 ps->ii = new_ii;1978 ps->ii = new_ii;
1969 gcc_assert (ps->min_cycle >= 0);1979 gcc_assert (ps->min_cycle >= 0);
19701980
@@ -2040,16 +2050,23 @@
2040 ps_insn_ptr crr_insn;2050 ps_insn_ptr crr_insn;
20412051
2042 for (row = 0; row < ps->ii; row++)2052 for (row = 0; row < ps->ii; row++)
2043 for (crr_insn = ps->rows[row]; crr_insn; crr_insn = crr_insn->next_in_row)2053 {
2044 {2054 int length = 0;
2045 ddg_node_ptr u = crr_insn->node;2055
20462056 for (crr_insn = ps->rows[row]; crr_insn; crr_insn = crr_insn->next_in_row)
2047 gcc_assert (TEST_BIT (sched_nodes, u->cuid));2057 {
2048 /* ??? Test also that all nodes of sched_nodes are in ps, perhaps by2058 ddg_node_ptr u = crr_insn->node;
2049 popcount (sched_nodes) == number of insns in ps. */2059
2050 gcc_assert (SCHED_TIME (u) >= ps->min_cycle);2060 length++;
2051 gcc_assert (SCHED_TIME (u) <= ps->max_cycle);2061 gcc_assert (TEST_BIT (sched_nodes, u->cuid));
2052 }2062 /* ??? Test also that all nodes of sched_nodes are in ps, perhaps by
2063 popcount (sched_nodes) == number of insns in ps. */
2064 gcc_assert (SCHED_TIME (u) >= ps->min_cycle);
2065 gcc_assert (SCHED_TIME (u) <= ps->max_cycle);
2066 }
2067
2068 gcc_assert (ps->rows_length[row] == length);
2069 }
2053}2070}
20542071
20552072
20562073
@@ -2455,6 +2472,7 @@
2455{2472{
2456 partial_schedule_ptr ps = XNEW (struct partial_schedule);2473 partial_schedule_ptr ps = XNEW (struct partial_schedule);
2457 ps->rows = (ps_insn_ptr *) xcalloc (ii, sizeof (ps_insn_ptr));2474 ps->rows = (ps_insn_ptr *) xcalloc (ii, sizeof (ps_insn_ptr));
2475 ps->rows_length = (int *) xcalloc (ii, sizeof (int));
2458 ps->ii = ii;2476 ps->ii = ii;
2459 ps->history = history;2477 ps->history = history;
2460 ps->min_cycle = INT_MAX;2478 ps->min_cycle = INT_MAX;
@@ -2493,6 +2511,7 @@
2493 return;2511 return;
2494 free_ps_insns (ps);2512 free_ps_insns (ps);
2495 free (ps->rows);2513 free (ps->rows);
2514 free (ps->rows_length);
2496 free (ps);2515 free (ps);
2497}2516}
24982517
@@ -2510,6 +2529,8 @@
2510 ps->rows = (ps_insn_ptr *) xrealloc (ps->rows, new_ii2529 ps->rows = (ps_insn_ptr *) xrealloc (ps->rows, new_ii
2511 * sizeof (ps_insn_ptr));2530 * sizeof (ps_insn_ptr));
2512 memset (ps->rows, 0, new_ii * sizeof (ps_insn_ptr));2531 memset (ps->rows, 0, new_ii * sizeof (ps_insn_ptr));
2532 ps->rows_length = (int *) xrealloc (ps->rows_length, new_ii * sizeof (int));
2533 memset (ps->rows_length, 0, new_ii * sizeof (int));
2513 ps->ii = new_ii;2534 ps->ii = new_ii;
2514 ps->min_cycle = INT_MAX;2535 ps->min_cycle = INT_MAX;
2515 ps->max_cycle = INT_MIN;2536 ps->max_cycle = INT_MIN;
@@ -2538,14 +2559,13 @@
25382559
2539/* Creates an object of PS_INSN and initializes it to the given parameters. */2560/* Creates an object of PS_INSN and initializes it to the given parameters. */
2540static ps_insn_ptr2561static ps_insn_ptr
2541create_ps_insn (ddg_node_ptr node, int rest_count, int cycle)2562create_ps_insn (ddg_node_ptr node, int cycle)
2542{2563{
2543 ps_insn_ptr ps_i = XNEW (struct ps_insn);2564 ps_insn_ptr ps_i = XNEW (struct ps_insn);
25442565
2545 ps_i->node = node;2566 ps_i->node = node;
2546 ps_i->next_in_row = NULL;2567 ps_i->next_in_row = NULL;
2547 ps_i->prev_in_row = NULL;2568 ps_i->prev_in_row = NULL;
2548 ps_i->row_rest_count = rest_count;
2549 ps_i->cycle = cycle;2569 ps_i->cycle = cycle;
25502570
2551 return ps_i;2571 return ps_i;
@@ -2578,6 +2598,8 @@
2578 if (ps_i->next_in_row)2598 if (ps_i->next_in_row)
2579 ps_i->next_in_row->prev_in_row = ps_i->prev_in_row;2599 ps_i->next_in_row->prev_in_row = ps_i->prev_in_row;
2580 }2600 }
2601
2602 ps->rows_length[row] -= 1;
2581 free (ps_i);2603 free (ps_i);
2582 return true;2604 return true;
2583}2605}
@@ -2734,17 +2756,12 @@
2734 sbitmap must_precede, sbitmap must_follow)2756 sbitmap must_precede, sbitmap must_follow)
2735{2757{
2736 ps_insn_ptr ps_i;2758 ps_insn_ptr ps_i;
2737 int rest_count = 1;
2738 int row = SMODULO (cycle, ps->ii);2759 int row = SMODULO (cycle, ps->ii);
27392760
2740 if (ps->rows[row]2761 if (ps->rows_length[row] >= issue_rate)
2741 && ps->rows[row]->row_rest_count >= issue_rate)
2742 return NULL;2762 return NULL;
27432763
2744 if (ps->rows[row])2764 ps_i = create_ps_insn (node, cycle);
2745 rest_count += ps->rows[row]->row_rest_count;
2746
2747 ps_i = create_ps_insn (node, rest_count, cycle);
27482765
2749 /* Finds and inserts PS_I according to MUST_FOLLOW and2766 /* Finds and inserts PS_I according to MUST_FOLLOW and
2750 MUST_PRECEDE. */2767 MUST_PRECEDE. */
@@ -2754,6 +2771,7 @@
2754 return NULL;2771 return NULL;
2755 }2772 }
27562773
2774 ps->rows_length[row] += 1;
2757 return ps_i;2775 return ps_i;
2758}2776}
27592777
@@ -2909,11 +2927,16 @@
2909 for (i = 0; i < backward_rotates; i++)2927 for (i = 0; i < backward_rotates; i++)
2910 {2928 {
2911 ps_insn_ptr first_row = ps->rows[0];2929 ps_insn_ptr first_row = ps->rows[0];
2930 int first_row_length = ps->rows_length[0];
29122931
2913 for (row = 0; row < last_row; row++)2932 for (row = 0; row < last_row; row++)
2914 ps->rows[row] = ps->rows[row+1];2933 {
2934 ps->rows[row] = ps->rows[row + 1];
2935 ps->rows_length[row] = ps->rows_length[row + 1];
2936 }
29152937
2916 ps->rows[last_row] = first_row;2938 ps->rows[last_row] = first_row;
2939 ps->rows_length[last_row] = first_row_length;
2917 }2940 }
29182941
2919 ps->max_cycle -= start_cycle;2942 ps->max_cycle -= start_cycle;

Subscribers

People subscribed via source and target branches