bool scop_do_block (scop_p scop) { bool strip_mined = false; bool interchanged = false; store_scattering (scop); strip_mined = lst_do_strip_mine (SCOP_TRANSFORMED_SCHEDULE (scop), 0); interchanged = scop_do_interchange (scop); /* If we don't interchange loops, the strip mine alone will not be profitable, and the transform is not a loop blocking: so revert the transform. */ if (!interchanged) { restore_scattering (scop); return false; } else if (strip_mined && interchanged && dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, "SCoP will be loop blocked.\n"); return strip_mined || interchanged; }
bool apply_poly_transforms (scop_p scop) { bool transform_done = false; /* Generate code even if we did not apply any real transformation. This also allows to check the performance for the identity transformation: GIMPLE -> GRAPHITE -> GIMPLE Keep in mind that CLooG optimizes in control, so the loop structure may change, even if we only use -fgraphite-identity. */ if (flag_graphite_identity) transform_done = true; if (flag_loop_parallelize_all) transform_done = true; if (flag_loop_block) transform_done |= scop_do_block (scop); else { if (flag_loop_strip_mine) transform_done |= scop_do_strip_mine (scop); if (flag_loop_interchange) transform_done |= scop_do_interchange (scop); } return transform_done; }
bool scop_do_block (scop_p scop) { store_scattering (scop); /* If we don't strip mine at least two loops, or not interchange loops, the strip mine alone will not be profitable, and the transform is not a loop blocking: so revert the transform. */ if (lst_do_strip_mine (SCOP_TRANSFORMED_SCHEDULE (scop), 0) < 2 || scop_do_interchange (scop) == 0) { restore_scattering (scop); return false; } if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, "SCoP will be loop blocked.\n"); return true; }