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; }
static bool lst_do_strip_mine (lst_p lst, int stride) { int i; lst_p l; bool res = false; int depth; if (!stride) stride = PARAM_VALUE (PARAM_LOOP_BLOCK_TILE_SIZE); if (!lst || !LST_LOOP_P (lst)) return false; FOR_EACH_VEC_ELT (lst_p, LST_SEQ (lst), i, l) res |= lst_do_strip_mine (l, stride); depth = lst_depth (lst); if (depth >= 0 && lst_strip_mine_profitable_p (lst, stride)) { res |= lst_do_strip_mine_loop (lst, lst_depth (lst), stride); lst_add_loop_under_loop (lst); } return res; }
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; }
bool scop_do_strip_mine (scop_p scop, int stride) { return lst_do_strip_mine (SCOP_TRANSFORMED_SCHEDULE (scop), stride); }