Merge lp:~eres/gcc-linaro/sms_fix_row_rest_count-4.6 into lp:gcc-linaro/4.6
- sms_fix_row_rest_count-4.6
- Merge into 4.6
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Richard Sandiford | Approve | ||
Review via email:
|
Commit message
Description of the change
SMS patch beckport from mainline:

Linaro Toolchain Builder (cbuild) wrote : | # |

Linaro Toolchain Builder (cbuild) wrote : | # |
cbuild successfully built this on armv7l-
The build results are available at:
http://
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://
cbuild-checked: armv7l-

Linaro Toolchain Builder (cbuild) wrote : | # |
cbuild successfully built this on i686-natty-
The build results are available at:
http://
The test suite results were unchanged compared to the branch point lp:gcc-linaro/4.6+bzr106767.
The full testsuite results are at:
http://
cbuild-checked: i686-natty-

Linaro Toolchain Builder (cbuild) wrote : | # |
cbuild successfully built this on x86_64-
The build results are available at:
http://
The test suite results were unchanged compared to the branch point lp:gcc-linaro/4.6+bzr106767.
The full testsuite results are at:
http://
cbuild-checked: x86_64-

Linaro Toolchain Builder (cbuild) wrote : | # |
cbuild successfully built this on i686-natty-
The build results are available at:
http://
The test suite results were unchanged compared to the branch point lp:gcc-linaro/4.6+bzr106767.
The full testsuite results are at:
http://
cbuild-checked: i686-natty-
Preview Diff
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 | 1 | 2011-07-04 Revital Eres <revital.eres@linaro.org> | ||
6 | 2 | |||
7 | 3 | * modulo-sched.c (struct ps_insn): Remove row_rest_count | ||
8 | 4 | field. | ||
9 | 5 | (struct partial_schedule): Add rows_length field. | ||
10 | 6 | (verify_partial_schedule): Check rows_length. | ||
11 | 7 | (ps_insert_empty_row): Handle rows_length. | ||
12 | 8 | (create_partial_schedule): Likewise. | ||
13 | 9 | (free_partial_schedule): Likewise. | ||
14 | 10 | (reset_partial_schedule): Likewise. | ||
15 | 11 | (create_ps_insn): Remove rest_count argument. | ||
16 | 12 | (remove_node_from_ps): Update rows_length. | ||
17 | 13 | (add_node_to_ps): Update rows_length and call create_ps_insn | ||
18 | 14 | without passing row_rest_count. | ||
19 | 15 | (rotate_partial_schedule): Update rows_length. | ||
20 | 16 | |||
21 | 1 | 2011-07-01 Andrew Stubbs <ams@codesourcery.com> | 17 | 2011-07-01 Andrew Stubbs <ams@codesourcery.com> |
22 | 2 | 18 | ||
23 | 3 | Merge from FSF GCC 4.6.1 (svn branches/gcc-4_6-branch 175677). | 19 | Merge from FSF GCC 4.6.1 (svn branches/gcc-4_6-branch 175677). |
24 | 4 | 20 | ||
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 | 134 | ps_insn_ptr next_in_row, | 134 | ps_insn_ptr next_in_row, |
30 | 135 | prev_in_row; | 135 | prev_in_row; |
31 | 136 | 136 | ||
32 | 137 | /* The number of nodes in the same row that come after this node. */ | ||
33 | 138 | int row_rest_count; | ||
34 | 139 | }; | 137 | }; |
35 | 140 | 138 | ||
36 | 141 | /* Holds the partial schedule as an array of II rows. Each entry of the | 139 | /* Holds the partial schedule as an array of II rows. Each entry of the |
37 | @@ -149,6 +147,12 @@ | |||
38 | 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). */ |
39 | 150 | ps_insn_ptr *rows; | 148 | ps_insn_ptr *rows; |
40 | 151 | 149 | ||
41 | 150 | /* rows_length[i] holds the number of instructions in the row. | ||
42 | 151 | It is used only (as an optimization) to back off quickly from | ||
43 | 152 | trying to schedule a node in a full row; that is, to avoid running | ||
44 | 153 | through futile DFA state transitions. */ | ||
45 | 154 | int *rows_length; | ||
46 | 155 | |||
47 | 152 | /* The earliest absolute cycle of an insn in the partial schedule. */ | 156 | /* The earliest absolute cycle of an insn in the partial schedule. */ |
48 | 153 | int min_cycle; | 157 | int min_cycle; |
49 | 154 | 158 | ||
50 | @@ -1907,6 +1911,7 @@ | |||
51 | 1907 | int ii = ps->ii; | 1911 | int ii = ps->ii; |
52 | 1908 | int new_ii = ii + 1; | 1912 | int new_ii = ii + 1; |
53 | 1909 | int row; | 1913 | int row; |
54 | 1914 | int *rows_length_new; | ||
55 | 1910 | 1915 | ||
56 | 1911 | verify_partial_schedule (ps, sched_nodes); | 1916 | verify_partial_schedule (ps, sched_nodes); |
57 | 1912 | 1917 | ||
58 | @@ -1921,9 +1926,11 @@ | |||
59 | 1921 | rotate_partial_schedule (ps, PS_MIN_CYCLE (ps)); | 1926 | rotate_partial_schedule (ps, PS_MIN_CYCLE (ps)); |
60 | 1922 | 1927 | ||
61 | 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)); |
62 | 1929 | rows_length_new = (int *) xcalloc (new_ii, sizeof (int)); | ||
63 | 1924 | for (row = 0; row < split_row; row++) | 1930 | for (row = 0; row < split_row; row++) |
64 | 1925 | { | 1931 | { |
65 | 1926 | rows_new[row] = ps->rows[row]; | 1932 | rows_new[row] = ps->rows[row]; |
66 | 1933 | rows_length_new[row] = ps->rows_length[row]; | ||
67 | 1927 | ps->rows[row] = NULL; | 1934 | ps->rows[row] = NULL; |
68 | 1928 | for (crr_insn = rows_new[row]; | 1935 | for (crr_insn = rows_new[row]; |
69 | 1929 | crr_insn; crr_insn = crr_insn->next_in_row) | 1936 | crr_insn; crr_insn = crr_insn->next_in_row) |
70 | @@ -1944,6 +1951,7 @@ | |||
71 | 1944 | for (row = split_row; row < ii; row++) | 1951 | for (row = split_row; row < ii; row++) |
72 | 1945 | { | 1952 | { |
73 | 1946 | rows_new[row + 1] = ps->rows[row]; | 1953 | rows_new[row + 1] = ps->rows[row]; |
74 | 1954 | rows_length_new[row + 1] = ps->rows_length[row]; | ||
75 | 1947 | ps->rows[row] = NULL; | 1955 | ps->rows[row] = NULL; |
76 | 1948 | for (crr_insn = rows_new[row + 1]; | 1956 | for (crr_insn = rows_new[row + 1]; |
77 | 1949 | crr_insn; crr_insn = crr_insn->next_in_row) | 1957 | crr_insn; crr_insn = crr_insn->next_in_row) |
78 | @@ -1965,6 +1973,8 @@ | |||
79 | 1965 | + (SMODULO (ps->max_cycle, ii) >= split_row ? 1 : 0); | 1973 | + (SMODULO (ps->max_cycle, ii) >= split_row ? 1 : 0); |
80 | 1966 | free (ps->rows); | 1974 | free (ps->rows); |
81 | 1967 | ps->rows = rows_new; | 1975 | ps->rows = rows_new; |
82 | 1976 | free (ps->rows_length); | ||
83 | 1977 | ps->rows_length = rows_length_new; | ||
84 | 1968 | ps->ii = new_ii; | 1978 | ps->ii = new_ii; |
85 | 1969 | gcc_assert (ps->min_cycle >= 0); | 1979 | gcc_assert (ps->min_cycle >= 0); |
86 | 1970 | 1980 | ||
87 | @@ -2040,16 +2050,23 @@ | |||
88 | 2040 | ps_insn_ptr crr_insn; | 2050 | ps_insn_ptr crr_insn; |
89 | 2041 | 2051 | ||
90 | 2042 | for (row = 0; row < ps->ii; row++) | 2052 | for (row = 0; row < ps->ii; row++) |
101 | 2043 | for (crr_insn = ps->rows[row]; crr_insn; crr_insn = crr_insn->next_in_row) | 2053 | { |
102 | 2044 | { | 2054 | int length = 0; |
103 | 2045 | ddg_node_ptr u = crr_insn->node; | 2055 | |
104 | 2046 | 2056 | for (crr_insn = ps->rows[row]; crr_insn; crr_insn = crr_insn->next_in_row) | |
105 | 2047 | gcc_assert (TEST_BIT (sched_nodes, u->cuid)); | 2057 | { |
106 | 2048 | /* ??? Test also that all nodes of sched_nodes are in ps, perhaps by | 2058 | ddg_node_ptr u = crr_insn->node; |
107 | 2049 | popcount (sched_nodes) == number of insns in ps. */ | 2059 | |
108 | 2050 | gcc_assert (SCHED_TIME (u) >= ps->min_cycle); | 2060 | length++; |
109 | 2051 | gcc_assert (SCHED_TIME (u) <= ps->max_cycle); | 2061 | gcc_assert (TEST_BIT (sched_nodes, u->cuid)); |
110 | 2052 | } | 2062 | /* ??? Test also that all nodes of sched_nodes are in ps, perhaps by |
111 | 2063 | popcount (sched_nodes) == number of insns in ps. */ | ||
112 | 2064 | gcc_assert (SCHED_TIME (u) >= ps->min_cycle); | ||
113 | 2065 | gcc_assert (SCHED_TIME (u) <= ps->max_cycle); | ||
114 | 2066 | } | ||
115 | 2067 | |||
116 | 2068 | gcc_assert (ps->rows_length[row] == length); | ||
117 | 2069 | } | ||
118 | 2053 | } | 2070 | } |
119 | 2054 | 2071 | ||
120 | 2055 | 2072 | ||
121 | 2056 | 2073 | ||
122 | @@ -2455,6 +2472,7 @@ | |||
123 | 2455 | { | 2472 | { |
124 | 2456 | partial_schedule_ptr ps = XNEW (struct partial_schedule); | 2473 | partial_schedule_ptr ps = XNEW (struct partial_schedule); |
125 | 2457 | ps->rows = (ps_insn_ptr *) xcalloc (ii, sizeof (ps_insn_ptr)); | 2474 | ps->rows = (ps_insn_ptr *) xcalloc (ii, sizeof (ps_insn_ptr)); |
126 | 2475 | ps->rows_length = (int *) xcalloc (ii, sizeof (int)); | ||
127 | 2458 | ps->ii = ii; | 2476 | ps->ii = ii; |
128 | 2459 | ps->history = history; | 2477 | ps->history = history; |
129 | 2460 | ps->min_cycle = INT_MAX; | 2478 | ps->min_cycle = INT_MAX; |
130 | @@ -2493,6 +2511,7 @@ | |||
131 | 2493 | return; | 2511 | return; |
132 | 2494 | free_ps_insns (ps); | 2512 | free_ps_insns (ps); |
133 | 2495 | free (ps->rows); | 2513 | free (ps->rows); |
134 | 2514 | free (ps->rows_length); | ||
135 | 2496 | free (ps); | 2515 | free (ps); |
136 | 2497 | } | 2516 | } |
137 | 2498 | 2517 | ||
138 | @@ -2510,6 +2529,8 @@ | |||
139 | 2510 | ps->rows = (ps_insn_ptr *) xrealloc (ps->rows, new_ii | 2529 | ps->rows = (ps_insn_ptr *) xrealloc (ps->rows, new_ii |
140 | 2511 | * sizeof (ps_insn_ptr)); | 2530 | * sizeof (ps_insn_ptr)); |
141 | 2512 | memset (ps->rows, 0, new_ii * sizeof (ps_insn_ptr)); | 2531 | memset (ps->rows, 0, new_ii * sizeof (ps_insn_ptr)); |
142 | 2532 | ps->rows_length = (int *) xrealloc (ps->rows_length, new_ii * sizeof (int)); | ||
143 | 2533 | memset (ps->rows_length, 0, new_ii * sizeof (int)); | ||
144 | 2513 | ps->ii = new_ii; | 2534 | ps->ii = new_ii; |
145 | 2514 | ps->min_cycle = INT_MAX; | 2535 | ps->min_cycle = INT_MAX; |
146 | 2515 | ps->max_cycle = INT_MIN; | 2536 | ps->max_cycle = INT_MIN; |
147 | @@ -2538,14 +2559,13 @@ | |||
148 | 2538 | 2559 | ||
149 | 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. */ |
150 | 2540 | static ps_insn_ptr | 2561 | static ps_insn_ptr |
152 | 2541 | create_ps_insn (ddg_node_ptr node, int rest_count, int cycle) | 2562 | create_ps_insn (ddg_node_ptr node, int cycle) |
153 | 2542 | { | 2563 | { |
154 | 2543 | ps_insn_ptr ps_i = XNEW (struct ps_insn); | 2564 | ps_insn_ptr ps_i = XNEW (struct ps_insn); |
155 | 2544 | 2565 | ||
156 | 2545 | ps_i->node = node; | 2566 | ps_i->node = node; |
157 | 2546 | ps_i->next_in_row = NULL; | 2567 | ps_i->next_in_row = NULL; |
158 | 2547 | ps_i->prev_in_row = NULL; | 2568 | ps_i->prev_in_row = NULL; |
159 | 2548 | ps_i->row_rest_count = rest_count; | ||
160 | 2549 | ps_i->cycle = cycle; | 2569 | ps_i->cycle = cycle; |
161 | 2550 | 2570 | ||
162 | 2551 | return ps_i; | 2571 | return ps_i; |
163 | @@ -2578,6 +2598,8 @@ | |||
164 | 2578 | if (ps_i->next_in_row) | 2598 | if (ps_i->next_in_row) |
165 | 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; |
166 | 2580 | } | 2600 | } |
167 | 2601 | |||
168 | 2602 | ps->rows_length[row] -= 1; | ||
169 | 2581 | free (ps_i); | 2603 | free (ps_i); |
170 | 2582 | return true; | 2604 | return true; |
171 | 2583 | } | 2605 | } |
172 | @@ -2734,17 +2756,12 @@ | |||
173 | 2734 | sbitmap must_precede, sbitmap must_follow) | 2756 | sbitmap must_precede, sbitmap must_follow) |
174 | 2735 | { | 2757 | { |
175 | 2736 | ps_insn_ptr ps_i; | 2758 | ps_insn_ptr ps_i; |
176 | 2737 | int rest_count = 1; | ||
177 | 2738 | int row = SMODULO (cycle, ps->ii); | 2759 | int row = SMODULO (cycle, ps->ii); |
178 | 2739 | 2760 | ||
181 | 2740 | if (ps->rows[row] | 2761 | if (ps->rows_length[row] >= issue_rate) |
180 | 2741 | && ps->rows[row]->row_rest_count >= issue_rate) | ||
182 | 2742 | return NULL; | 2762 | return NULL; |
183 | 2743 | 2763 | ||
188 | 2744 | if (ps->rows[row]) | 2764 | ps_i = create_ps_insn (node, cycle); |
185 | 2745 | rest_count += ps->rows[row]->row_rest_count; | ||
186 | 2746 | |||
187 | 2747 | ps_i = create_ps_insn (node, rest_count, cycle); | ||
189 | 2748 | 2765 | ||
190 | 2749 | /* Finds and inserts PS_I according to MUST_FOLLOW and | 2766 | /* Finds and inserts PS_I according to MUST_FOLLOW and |
191 | 2750 | MUST_PRECEDE. */ | 2767 | MUST_PRECEDE. */ |
192 | @@ -2754,6 +2771,7 @@ | |||
193 | 2754 | return NULL; | 2771 | return NULL; |
194 | 2755 | } | 2772 | } |
195 | 2756 | 2773 | ||
196 | 2774 | ps->rows_length[row] += 1; | ||
197 | 2757 | return ps_i; | 2775 | return ps_i; |
198 | 2758 | } | 2776 | } |
199 | 2759 | 2777 | ||
200 | @@ -2909,11 +2927,16 @@ | |||
201 | 2909 | for (i = 0; i < backward_rotates; i++) | 2927 | for (i = 0; i < backward_rotates; i++) |
202 | 2910 | { | 2928 | { |
203 | 2911 | ps_insn_ptr first_row = ps->rows[0]; | 2929 | ps_insn_ptr first_row = ps->rows[0]; |
204 | 2930 | int first_row_length = ps->rows_length[0]; | ||
205 | 2912 | 2931 | ||
206 | 2913 | for (row = 0; row < last_row; row++) | 2932 | for (row = 0; row < last_row; row++) |
208 | 2914 | ps->rows[row] = ps->rows[row+1]; | 2933 | { |
209 | 2934 | ps->rows[row] = ps->rows[row + 1]; | ||
210 | 2935 | ps->rows_length[row] = ps->rows_length[row + 1]; | ||
211 | 2936 | } | ||
212 | 2915 | 2937 | ||
213 | 2916 | ps->rows[last_row] = first_row; | 2938 | ps->rows[last_row] = first_row; |
214 | 2939 | ps->rows_length[last_row] = first_row_length; | ||
215 | 2917 | } | 2940 | } |
216 | 2918 | 2941 | ||
217 | 2919 | ps->max_cycle -= start_cycle; | 2942 | ps->max_cycle -= start_cycle; |
cbuild has taken a snapshot of this branch at r106768 and queued it for build.
The snapshot is available at: ex.seabright. co.nz/snapshots /gcc-linaro- 4.6+bzr106768~ eres~sms_ fix_row_ rest_count- 4.6.tar. xdelta3. xz
http://
and will be built on the following builders:
a9-builder armv5-builder i686 x86_64
You can track the build queue at: ex.seabright. co.nz/helpers/ scheduler
http://
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