Mercurial > hg > CbC > CbC_gcc
comparison gcc/tree-ssa-loop-unswitch.c @ 63:b7f97abdc517 gcc-4.6-20100522
update gcc from gcc-4.5.0 to gcc-4.6
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 24 May 2010 12:47:05 +0900 |
parents | 77e2b8dfacca |
children | f6334be47118 |
comparison
equal
deleted
inserted
replaced
56:3c8a44c06a95 | 63:b7f97abdc517 |
---|---|
20 #include "config.h" | 20 #include "config.h" |
21 #include "system.h" | 21 #include "system.h" |
22 #include "coretypes.h" | 22 #include "coretypes.h" |
23 #include "tm.h" | 23 #include "tm.h" |
24 #include "tree.h" | 24 #include "tree.h" |
25 #include "rtl.h" | |
26 #include "tm_p.h" | 25 #include "tm_p.h" |
27 #include "hard-reg-set.h" | |
28 #include "basic-block.h" | 26 #include "basic-block.h" |
29 #include "output.h" | 27 #include "output.h" |
30 #include "diagnostic.h" | 28 #include "diagnostic.h" |
31 #include "tree-flow.h" | 29 #include "tree-flow.h" |
32 #include "tree-dump.h" | 30 #include "tree-dump.h" |
86 bool changed = false; | 84 bool changed = false; |
87 | 85 |
88 /* Go through inner loops (only original ones). */ | 86 /* Go through inner loops (only original ones). */ |
89 FOR_EACH_LOOP (li, loop, LI_ONLY_INNERMOST) | 87 FOR_EACH_LOOP (li, loop, LI_ONLY_INNERMOST) |
90 { | 88 { |
89 if (dump_file && (dump_flags & TDF_DETAILS)) | |
90 fprintf (dump_file, ";; Considering loop %d\n", loop->num); | |
91 | |
92 /* Do not unswitch in cold regions. */ | |
93 if (optimize_loop_for_size_p (loop)) | |
94 { | |
95 if (dump_file && (dump_flags & TDF_DETAILS)) | |
96 fprintf (dump_file, ";; Not unswitching cold loops\n"); | |
97 continue; | |
98 } | |
99 | |
100 /* The loop should not be too large, to limit code growth. */ | |
101 if (tree_num_loop_insns (loop, &eni_size_weights) | |
102 > (unsigned) PARAM_VALUE (PARAM_MAX_UNSWITCH_INSNS)) | |
103 { | |
104 if (dump_file && (dump_flags & TDF_DETAILS)) | |
105 fprintf (dump_file, ";; Not unswitching, loop too big\n"); | |
106 continue; | |
107 } | |
108 | |
91 changed |= tree_unswitch_single_loop (loop, 0); | 109 changed |= tree_unswitch_single_loop (loop, 0); |
92 } | 110 } |
93 | 111 |
94 if (changed) | 112 if (changed) |
95 return TODO_cleanup_cfg; | 113 return TODO_cleanup_cfg; |
184 /* Do not unswitch too much. */ | 202 /* Do not unswitch too much. */ |
185 if (num > PARAM_VALUE (PARAM_MAX_UNSWITCH_LEVEL)) | 203 if (num > PARAM_VALUE (PARAM_MAX_UNSWITCH_LEVEL)) |
186 { | 204 { |
187 if (dump_file && (dump_flags & TDF_DETAILS)) | 205 if (dump_file && (dump_flags & TDF_DETAILS)) |
188 fprintf (dump_file, ";; Not unswitching anymore, hit max level\n"); | 206 fprintf (dump_file, ";; Not unswitching anymore, hit max level\n"); |
189 return false; | |
190 } | |
191 | |
192 /* Only unswitch innermost loops. */ | |
193 if (loop->inner) | |
194 { | |
195 if (dump_file && (dump_flags & TDF_DETAILS)) | |
196 fprintf (dump_file, ";; Not unswitching, not innermost loop\n"); | |
197 return false; | |
198 } | |
199 | |
200 /* Do not unswitch in cold regions. */ | |
201 if (optimize_loop_for_size_p (loop)) | |
202 { | |
203 if (dump_file && (dump_flags & TDF_DETAILS)) | |
204 fprintf (dump_file, ";; Not unswitching cold loops\n"); | |
205 return false; | |
206 } | |
207 | |
208 /* The loop should not be too large, to limit code growth. */ | |
209 if (tree_num_loop_insns (loop, &eni_size_weights) | |
210 > (unsigned) PARAM_VALUE (PARAM_MAX_UNSWITCH_INSNS)) | |
211 { | |
212 if (dump_file && (dump_flags & TDF_DETAILS)) | |
213 fprintf (dump_file, ";; Not unswitching, loop too big\n"); | |
214 return false; | 207 return false; |
215 } | 208 } |
216 | 209 |
217 i = 0; | 210 i = 0; |
218 bbs = get_loop_body (loop); | 211 bbs = get_loop_body (loop); |