fprintf (file, "\n");
}
- fprintf (file, ";; depth %d, outer %ld\n",
+ fprintf (file, ";; depth %d, outer %ld",
loop_depth (loop), (long) (loop_outer (loop)
? loop_outer (loop)->num : -1));
+ print_loop_info (file, loop, ";; ");
- bool reliable;
- sreal iterations;
- if (loop->num && expected_loop_iterations_by_profile (loop, &iterations, &reliable))
- fprintf (file, ";; profile-based iteration count: %f %s\n",
- iterations.to_double (), reliable ? "(reliable)" : "(unreliable)");
-
- fprintf (file, ";; nodes:");
+ fprintf (file, "\n;; nodes:");
bbs = get_loop_body (loop);
for (i = 0; i < loop->num_nodes; i++)
fprintf (file, " %d", bbs[i]->index);
}
}
+/* Print loop information. */
+
+void
+print_loop_info (FILE *file, const class loop *loop, const char *prefix)
+{
+ if (loop->can_be_parallel)
+ fprintf (file, ", can_be_parallel");
+ if (loop->warned_aggressive_loop_optimizations)
+ fprintf (file, ", warned_aggressive_loop_optimizations");
+ if (loop->dont_vectorize)
+ fprintf (file, ", dont_vectorize");
+ if (loop->force_vectorize)
+ fprintf (file, ", force_vectorize");
+ if (loop->in_oacc_kernels_region)
+ fprintf (file, ", in_oacc_kernels_region");
+ if (loop->finite_p)
+ fprintf (file, ", finite_p");
+ if (loop->unroll)
+ fprintf (file, "\n%sunroll %d", prefix, loop->unroll);
+ if (loop->nb_iterations)
+ {
+ fprintf (file, "\n%sniter ", prefix);
+ print_generic_expr (file, loop->nb_iterations);
+ }
+
+ if (loop->any_upper_bound)
+ {
+ fprintf (file, "\n%supper_bound ", prefix);
+ print_decu (loop->nb_iterations_upper_bound, file);
+ }
+ if (loop->any_likely_upper_bound)
+ {
+ fprintf (file, "\n%slikely_upper_bound ", prefix);
+ print_decu (loop->nb_iterations_likely_upper_bound, file);
+ }
+
+ if (loop->any_estimate)
+ {
+ fprintf (file, "\n%sestimate ", prefix);
+ print_decu (loop->nb_iterations_estimate, file);
+ }
+ bool reliable;
+ sreal iterations;
+ if (loop->num && expected_loop_iterations_by_profile (loop, &iterations, &reliable))
+ fprintf (file, "\n%siterations by profile: %f %s", prefix,
+ iterations.to_double (), reliable ? "(reliable)" : "(unreliable)");
+
+}
+
static void print_loop_and_siblings (FILE *, class loop *, int, int);
/* Pretty print LOOP on FILE, indented INDENT spaces. Following
fprintf (file, ", latch = %d", loop->latch->index);
else
fprintf (file, ", multiple latches");
- fprintf (file, ", niter = ");
- print_generic_expr (file, loop->nb_iterations);
-
- if (loop->any_upper_bound)
- {
- fprintf (file, ", upper_bound = ");
- print_decu (loop->nb_iterations_upper_bound, file);
- }
- if (loop->any_likely_upper_bound)
- {
- fprintf (file, ", likely_upper_bound = ");
- print_decu (loop->nb_iterations_likely_upper_bound, file);
- }
-
- if (loop->any_estimate)
- {
- fprintf (file, ", estimate = ");
- print_decu (loop->nb_iterations_estimate, file);
- }
- if (loop->unroll)
- fprintf (file, ", unroll = %d", loop->unroll);
+ print_loop_info (file, loop, s_indent);
fprintf (file, ")\n");
/* Print loop's body. */