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

Proposed by Revital Eres
Status: Merged
Approved by: Richard Sandiford
Approved revision: no longer in the source branch.
Merged at revision: 106771
Proposed branch: lp:~eres/gcc-linaro/sms_fix_row_rest_count-4.6
Merge into: lp:gcc-linaro/4.6
Diff against target: 216 lines (+61/-22)
2 files modified
ChangeLog.linaro (+16/-0)
gcc/modulo-sched.c (+45/-22)
To merge this branch: bzr merge lp:~eres/gcc-linaro/sms_fix_row_rest_count-4.6
Reviewer Review Type Date Requested Status
Richard Sandiford Approve
Review via email: mp+66780@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 r106768 and queued it for build.

The snapshot is available at:
 http://ex.seabright.co.nz/snapshots/gcc-linaro-4.6+bzr106768~eres~sms_fix_row_rest_count-4.6.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.6+bzr106768~eres~sms_fix_row_rest_count-4.6
cbuild-ancestor: lp:gcc-linaro/4.6+bzr106767
cbuild-state: check

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

cbuild successfully built this on armv7l-natty-cbuild149-ursa1-cortexa9r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106768~eres~sms_fix_row_rest_count-4.6/logs/armv7l-natty-cbuild149-ursa1-cortexa9r1

The test suite results changed compared to the branch point lp:gcc-linaro/4.6+bzr106767:
 -WARNING: program timed out.

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106768~eres~sms_fix_row_rest_count-4.6/logs/armv7l-natty-cbuild149-ursa1-cortexa9r1/gcc-testsuite.txt

cbuild-checked: armv7l-natty-cbuild149-ursa1-cortexa9r1

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

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

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

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

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

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

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.6+bzr106768~eres~sms_fix_row_rest_count-4.6/logs/x86_64-natty-cbuild148-oort1-x86_64r1

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

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106768~eres~sms_fix_row_rest_count-4.6/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 i686-natty-cbuild151-oort2-i686r1.

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

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

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106768~eres~sms_fix_row_rest_count-4.6/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
1=== modified file 'ChangeLog.linaro'
2--- ChangeLog.linaro 2011-07-04 11:13:51 +0000
3+++ ChangeLog.linaro 2011-07-04 12:09:47 +0000
4@@ -1,3 +1,19 @@
5+2011-07-04 Revital Eres <revital.eres@linaro.org>
6+
7+ * modulo-sched.c (struct ps_insn): Remove row_rest_count
8+ field.
9+ (struct partial_schedule): Add rows_length field.
10+ (verify_partial_schedule): Check rows_length.
11+ (ps_insert_empty_row): Handle rows_length.
12+ (create_partial_schedule): Likewise.
13+ (free_partial_schedule): Likewise.
14+ (reset_partial_schedule): Likewise.
15+ (create_ps_insn): Remove rest_count argument.
16+ (remove_node_from_ps): Update rows_length.
17+ (add_node_to_ps): Update rows_length and call create_ps_insn
18+ without passing row_rest_count.
19+ (rotate_partial_schedule): Update rows_length.
20+
21 2011-07-01 Andrew Stubbs <ams@codesourcery.com>
22
23 Merge from FSF GCC 4.6.1 (svn branches/gcc-4_6-branch 175677).
24
25=== modified file 'gcc/modulo-sched.c'
26--- gcc/modulo-sched.c 2011-05-13 16:03:40 +0000
27+++ gcc/modulo-sched.c 2011-07-04 12:09:47 +0000
28@@ -134,8 +134,6 @@
29 ps_insn_ptr next_in_row,
30 prev_in_row;
31
32- /* The number of nodes in the same row that come after this node. */
33- int row_rest_count;
34 };
35
36 /* Holds the partial schedule as an array of II rows. Each entry of the
37@@ -149,6 +147,12 @@
38 /* rows[i] points to linked list of insns scheduled in row i (0<=i<ii). */
39 ps_insn_ptr *rows;
40
41+ /* rows_length[i] holds the number of instructions in the row.
42+ It is used only (as an optimization) to back off quickly from
43+ trying to schedule a node in a full row; that is, to avoid running
44+ through futile DFA state transitions. */
45+ int *rows_length;
46+
47 /* The earliest absolute cycle of an insn in the partial schedule. */
48 int min_cycle;
49
50@@ -1907,6 +1911,7 @@
51 int ii = ps->ii;
52 int new_ii = ii + 1;
53 int row;
54+ int *rows_length_new;
55
56 verify_partial_schedule (ps, sched_nodes);
57
58@@ -1921,9 +1926,11 @@
59 rotate_partial_schedule (ps, PS_MIN_CYCLE (ps));
60
61 rows_new = (ps_insn_ptr *) xcalloc (new_ii, sizeof (ps_insn_ptr));
62+ rows_length_new = (int *) xcalloc (new_ii, sizeof (int));
63 for (row = 0; row < split_row; row++)
64 {
65 rows_new[row] = ps->rows[row];
66+ rows_length_new[row] = ps->rows_length[row];
67 ps->rows[row] = NULL;
68 for (crr_insn = rows_new[row];
69 crr_insn; crr_insn = crr_insn->next_in_row)
70@@ -1944,6 +1951,7 @@
71 for (row = split_row; row < ii; row++)
72 {
73 rows_new[row + 1] = ps->rows[row];
74+ rows_length_new[row + 1] = ps->rows_length[row];
75 ps->rows[row] = NULL;
76 for (crr_insn = rows_new[row + 1];
77 crr_insn; crr_insn = crr_insn->next_in_row)
78@@ -1965,6 +1973,8 @@
79 + (SMODULO (ps->max_cycle, ii) >= split_row ? 1 : 0);
80 free (ps->rows);
81 ps->rows = rows_new;
82+ free (ps->rows_length);
83+ ps->rows_length = rows_length_new;
84 ps->ii = new_ii;
85 gcc_assert (ps->min_cycle >= 0);
86
87@@ -2040,16 +2050,23 @@
88 ps_insn_ptr crr_insn;
89
90 for (row = 0; row < ps->ii; row++)
91- for (crr_insn = ps->rows[row]; crr_insn; crr_insn = crr_insn->next_in_row)
92- {
93- ddg_node_ptr u = crr_insn->node;
94-
95- gcc_assert (TEST_BIT (sched_nodes, u->cuid));
96- /* ??? Test also that all nodes of sched_nodes are in ps, perhaps by
97- popcount (sched_nodes) == number of insns in ps. */
98- gcc_assert (SCHED_TIME (u) >= ps->min_cycle);
99- gcc_assert (SCHED_TIME (u) <= ps->max_cycle);
100- }
101+ {
102+ int length = 0;
103+
104+ for (crr_insn = ps->rows[row]; crr_insn; crr_insn = crr_insn->next_in_row)
105+ {
106+ ddg_node_ptr u = crr_insn->node;
107+
108+ length++;
109+ gcc_assert (TEST_BIT (sched_nodes, u->cuid));
110+ /* ??? Test also that all nodes of sched_nodes are in ps, perhaps by
111+ popcount (sched_nodes) == number of insns in ps. */
112+ gcc_assert (SCHED_TIME (u) >= ps->min_cycle);
113+ gcc_assert (SCHED_TIME (u) <= ps->max_cycle);
114+ }
115+
116+ gcc_assert (ps->rows_length[row] == length);
117+ }
118 }
119
120
121
122@@ -2455,6 +2472,7 @@
123 {
124 partial_schedule_ptr ps = XNEW (struct partial_schedule);
125 ps->rows = (ps_insn_ptr *) xcalloc (ii, sizeof (ps_insn_ptr));
126+ ps->rows_length = (int *) xcalloc (ii, sizeof (int));
127 ps->ii = ii;
128 ps->history = history;
129 ps->min_cycle = INT_MAX;
130@@ -2493,6 +2511,7 @@
131 return;
132 free_ps_insns (ps);
133 free (ps->rows);
134+ free (ps->rows_length);
135 free (ps);
136 }
137
138@@ -2510,6 +2529,8 @@
139 ps->rows = (ps_insn_ptr *) xrealloc (ps->rows, new_ii
140 * sizeof (ps_insn_ptr));
141 memset (ps->rows, 0, new_ii * sizeof (ps_insn_ptr));
142+ ps->rows_length = (int *) xrealloc (ps->rows_length, new_ii * sizeof (int));
143+ memset (ps->rows_length, 0, new_ii * sizeof (int));
144 ps->ii = new_ii;
145 ps->min_cycle = INT_MAX;
146 ps->max_cycle = INT_MIN;
147@@ -2538,14 +2559,13 @@
148
149 /* Creates an object of PS_INSN and initializes it to the given parameters. */
150 static ps_insn_ptr
151-create_ps_insn (ddg_node_ptr node, int rest_count, int cycle)
152+create_ps_insn (ddg_node_ptr node, int cycle)
153 {
154 ps_insn_ptr ps_i = XNEW (struct ps_insn);
155
156 ps_i->node = node;
157 ps_i->next_in_row = NULL;
158 ps_i->prev_in_row = NULL;
159- ps_i->row_rest_count = rest_count;
160 ps_i->cycle = cycle;
161
162 return ps_i;
163@@ -2578,6 +2598,8 @@
164 if (ps_i->next_in_row)
165 ps_i->next_in_row->prev_in_row = ps_i->prev_in_row;
166 }
167+
168+ ps->rows_length[row] -= 1;
169 free (ps_i);
170 return true;
171 }
172@@ -2734,17 +2756,12 @@
173 sbitmap must_precede, sbitmap must_follow)
174 {
175 ps_insn_ptr ps_i;
176- int rest_count = 1;
177 int row = SMODULO (cycle, ps->ii);
178
179- if (ps->rows[row]
180- && ps->rows[row]->row_rest_count >= issue_rate)
181+ if (ps->rows_length[row] >= issue_rate)
182 return NULL;
183
184- if (ps->rows[row])
185- rest_count += ps->rows[row]->row_rest_count;
186-
187- ps_i = create_ps_insn (node, rest_count, cycle);
188+ ps_i = create_ps_insn (node, cycle);
189
190 /* Finds and inserts PS_I according to MUST_FOLLOW and
191 MUST_PRECEDE. */
192@@ -2754,6 +2771,7 @@
193 return NULL;
194 }
195
196+ ps->rows_length[row] += 1;
197 return ps_i;
198 }
199
200@@ -2909,11 +2927,16 @@
201 for (i = 0; i < backward_rotates; i++)
202 {
203 ps_insn_ptr first_row = ps->rows[0];
204+ int first_row_length = ps->rows_length[0];
205
206 for (row = 0; row < last_row; row++)
207- ps->rows[row] = ps->rows[row+1];
208+ {
209+ ps->rows[row] = ps->rows[row + 1];
210+ ps->rows_length[row] = ps->rows_length[row + 1];
211+ }
212
213 ps->rows[last_row] = first_row;
214+ ps->rows_length[last_row] = first_row_length;
215 }
216
217 ps->max_cycle -= start_cycle;

Subscribers

People subscribed via source and target branches