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

Subscribers

People subscribed via source and target branches