https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118555
Bug ID: 118555
Summary: -fopt-info reporting of why
decide_unroll_constant_iterations decides against
unrolling could be improved
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: tiborgyri at gmail dot com
CC: tiborgyri at gmail dot com
Target Milestone: ---
When decide_unroll_constant_iterations runs it does emit a dump message to the
terminal:
---
dump_printf (MSG_NOTE,
"considering unrolling loop with constant "
"number of iterations\n");
---
and if it does decide to unroll, report_unroll issues a passed-optimization
message, nicely attached to a source location:
---
dump_printf_loc (metadata, locus.get_user_location (),
"loop unrolled %d times",
loop->lpt_decision.times);
---
Unfortunately when decide_unroll_constant_iterations decides against unrolling
no messages are emitted. There are sections like this in the code:
---
if (dump_file)
fprintf (dump_file, ";; Not considering loop, is too big\n");
---
but I think it would be a lot more useful if these would be emitted with
dump_printf, or preferably with dump_printf_loc.
I would also like to note that this fprintf (dump_file, ...) idiom is not
documented at https://gcc.gnu.org/onlinedocs/gccint/Dump-types.html