comparison gcc/graphite-blocking.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
179 static bool 179 static bool
180 pbb_strip_mine_profitable_p (poly_bb_p pbb, 180 pbb_strip_mine_profitable_p (poly_bb_p pbb,
181 graphite_dim_t depth, 181 graphite_dim_t depth,
182 int stride) 182 int stride)
183 { 183 {
184 Value niter, strip_stride; 184 mpz_t niter, strip_stride;
185 bool res; 185 bool res;
186 186
187 value_init (strip_stride); 187 mpz_init (strip_stride);
188 value_init (niter); 188 mpz_init (niter);
189 value_set_si (strip_stride, stride); 189 mpz_set_si (strip_stride, stride);
190 pbb_number_of_iterations_at_time (pbb, psct_dynamic_dim (pbb, depth), niter); 190 pbb_number_of_iterations_at_time (pbb, psct_dynamic_dim (pbb, depth), niter);
191 res = value_gt (niter, strip_stride); 191 res = (mpz_cmp (niter, strip_stride) > 0);
192 value_clear (strip_stride); 192 mpz_clear (strip_stride);
193 value_clear (niter); 193 mpz_clear (niter);
194 194
195 return res; 195 return res;
196 } 196 }
197 197
198 /* Strip-mines all the loops of LST that are considered profitable to 198 /* Strip-mines all the loops of LST that are considered profitable to
283 block some loops. */ 283 block some loops. */
284 284
285 bool 285 bool
286 scop_do_block (scop_p scop) 286 scop_do_block (scop_p scop)
287 { 287 {
288 bool transform_done = false; 288 bool strip_mined = false;
289 bool interchanged = false;
289 290
290 store_scattering (scop); 291 store_scattering (scop);
291 292
292 lst_do_strip_mine (SCOP_TRANSFORMED_SCHEDULE (scop)); 293 strip_mined = lst_do_strip_mine (SCOP_TRANSFORMED_SCHEDULE (scop));
293 transform_done = scop_do_interchange (scop); 294 interchanged = scop_do_interchange (scop);
294 295
295 /* If we don't interchange loops, then the strip mine is not 296 /* If we don't interchange loops, then the strip mine is not
296 profitable, and the transform is not a loop blocking. */ 297 profitable, and the transform is not a loop blocking. */
297 if (!transform_done 298 if (!interchanged
298 || !graphite_legal_transform (scop)) 299 || !graphite_legal_transform (scop))
299 { 300 {
300 restore_scattering (scop); 301 restore_scattering (scop);
301 return false; 302 return false;
302 } 303 }
303 else if (dump_file && (dump_flags & TDF_DETAILS)) 304 else if (strip_mined && interchanged
305 && dump_file && (dump_flags & TDF_DETAILS))
304 fprintf (dump_file, "SCoP will be loop blocked.\n"); 306 fprintf (dump_file, "SCoP will be loop blocked.\n");
305 307
306 return transform_done; 308 return strip_mined || interchanged;
307 } 309 }
308 310
309 #endif 311 #endif