This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 7/8] tree-ssa-loop-im.c port from fprintf to the dump API
- From: David Malcolm <dmalcolm at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, David Malcolm <dmalcolm at redhat dot com>
- Date: Thu, 14 Jun 2018 16:32:54 -0400
- Subject: [PATCH 7/8] tree-ssa-loop-im.c port from fprintf to the dump API
- References: <CAFiYyc0BVW1m-YTem7kbkw5T3+gXcZvKS-HHv-PCj7+=r9Lm7w@mail.gmail.com> <1529008375-20819-1-git-send-email-dmalcolm@redhat.com>
More porting from fprintf to using the dump API, so that
the messages appear in -fopt-info etc.
Note how these messages aren't consolidated into one
optimization record by the v2 patch kit.
gcc/ChangeLog:
* tree-ssa-loop-im.c (move_computations_worker): Port from
fprintf to the dump API.
---
gcc/tree-ssa-loop-im.c | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index 01a954e..b701171 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -1117,12 +1117,16 @@ move_computations_worker (basic_block bb)
continue;
}
- if (dump_file && (dump_flags & TDF_DETAILS))
+ if (dump_enabled_p ())
{
- fprintf (dump_file, "Moving PHI node\n");
- print_gimple_stmt (dump_file, stmt, 0);
- fprintf (dump_file, "(cost %u) out of loop %d.\n\n",
- cost, level->num);
+ /* FIXME: consolidation etc. */
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS | TDF_DETAILS, stmt,
+ "Moving PHI node\n");
+ dump_gimple_stmt (MSG_OPTIMIZED_LOCATIONS | TDF_DETAILS, TDF_SLIM,
+ stmt, 0);
+ dump_printf (MSG_OPTIMIZED_LOCATIONS | TDF_DETAILS,
+ " (cost %u) out of loop %d.\n\n",
+ cost, level->num);
}
if (gimple_phi_num_args (stmt) == 1)
@@ -1186,12 +1190,14 @@ move_computations_worker (basic_block bb)
if (gimple_code (stmt) == GIMPLE_COND)
continue;
- if (dump_file && (dump_flags & TDF_DETAILS))
+ if (dump_enabled_p ())
{
- fprintf (dump_file, "Moving statement\n");
- print_gimple_stmt (dump_file, stmt, 0);
- fprintf (dump_file, "(cost %u) out of loop %d.\n\n",
- cost, level->num);
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS | TDF_DETAILS, stmt,
+ "Moving statement\n");
+ dump_gimple_stmt (MSG_OPTIMIZED_LOCATIONS | TDF_DETAILS, TDF_SLIM, stmt, 0);
+ dump_printf (MSG_OPTIMIZED_LOCATIONS | TDF_DETAILS,
+ "(cost %u) out of loop %d.\n\n",
+ cost, level->num);
}
e = loop_preheader_edge (level);
--
1.8.5.3