static inline void graphite_verify (void) { #ifdef ENABLE_CHECKING verify_loop_structure (); verify_dominators (CDI_DOMINATORS); verify_dominators (CDI_POST_DOMINATORS); verify_ssa (false); verify_loop_closed_ssa (); #endif }
/* Main entry point. Perform loop unswitching on all suitable LOOPS. */ void unswitch_loops (struct loops *loops) { int i, num; struct loop *loop; /* Go through inner loops (only original ones). */ num = loops->num; for (i = 1; i < num; i++) { /* Removed loop? */ loop = loops->parray[i]; if (!loop) continue; if (loop->inner) continue; unswitch_single_loop (loops, loop, NULL_RTX, 0); #ifdef ENABLE_CHECKING verify_dominators (CDI_DOMINATORS); verify_loop_structure (loops); #endif } iv_analysis_done (); }
struct loops * loop_optimizer_init (FILE *dumpfile) { struct loops *loops = xcalloc (1, sizeof (struct loops)); edge e; edge_iterator ei; static bool first_time = true; if (first_time) { first_time = false; init_set_costs (); } /* Avoid annoying special cases of edges going to exit block. */ for (ei = ei_start (EXIT_BLOCK_PTR->preds); (e = ei_safe_edge (ei)); ) if ((e->flags & EDGE_FALLTHRU) && !single_succ_p (e->src)) split_edge (e); else ei_next (&ei); /* Find the loops. */ if (flow_loops_find (loops) <= 1) { /* No loops. */ flow_loops_free (loops); free (loops); return NULL; } /* Not going to update these. */ free (loops->cfg.rc_order); loops->cfg.rc_order = NULL; free (loops->cfg.dfs_order); loops->cfg.dfs_order = NULL; /* Create pre-headers. */ create_preheaders (loops, CP_SIMPLE_PREHEADERS); /* Force all latches to have only single successor. */ force_single_succ_latches (loops); /* Mark irreducible loops. */ mark_irreducible_loops (loops); /* Dump loops. */ flow_loops_dump (loops, dumpfile, NULL, 1); #ifdef ENABLE_CHECKING verify_dominators (CDI_DOMINATORS); verify_loop_structure (loops); #endif return loops; }
/* Main entry point. Perform loop unswitching on all suitable loops. */ void unswitch_loops (void) { loop_iterator li; struct loop *loop; /* Go through inner loops (only original ones). */ FOR_EACH_LOOP (li, loop, LI_ONLY_INNERMOST) { unswitch_single_loop (loop, NULL_RTX, 0); #ifdef ENABLE_CHECKING verify_dominators (CDI_DOMINATORS); verify_loop_structure (); #endif }
void doloop_optimize_loops (struct loops *loops) { unsigned i; struct loop *loop; for (i = 1; i < loops->num; i++) { loop = loops->parray[i]; if (!loop) continue; doloop_optimize (loop); } iv_analysis_done (); #ifdef ENABLE_CHECKING verify_dominators (CDI_DOMINATORS); verify_loop_structure (loops); #endif }