public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Martin Liska <marxin@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/users/marxin/heads/loop-unswitch-improvement-v7)] Use dump_printf_loc.
Date: Thu,  9 Dec 2021 12:48:42 +0000 (GMT)	[thread overview]
Message-ID: <20211209124842.1B53E3858431@sourceware.org> (raw)

https://gcc.gnu.org/g:890edf89dd940b3081b34f9bfee163402d27c875

commit 890edf89dd940b3081b34f9bfee163402d27c875
Author: Martin Liska <mliska@suse.cz>
Date:   Tue Dec 7 16:19:47 2021 +0100

    Use dump_printf_loc.

Diff:
---
 gcc/tree-ssa-loop-unswitch.c | 27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c
index 33fd7bad6d9..6e25eb703fe 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -820,9 +820,9 @@ tree_unswitch_single_loop (class loop *loop, int num,
   basic_block bb = NULL;
   if (num > param_max_unswitch_level)
     {
-      if (dump_file
-	  && (dump_flags & TDF_DETAILS))
-	fprintf (dump_file, ";; Not unswitching anymore, hit max level\n");
+      if (dump_enabled_p ())
+	dump_printf_loc (MSG_MISSED_OPTIMIZATION, loc,
+			 "Not unswitching anymore, hit max level\n");
       goto exit;
     }
 
@@ -849,13 +849,10 @@ tree_unswitch_single_loop (class loop *loop, int num,
 	      budget -= cost;
 	      break;
 	    }
-	  else if (dump_file && (dump_flags & TDF_DETAILS))
-	    {
-	      fprintf (dump_file, ";; Not unswitching condition, cost too big "
-		       "(%d insns): ", cost);
-	      print_generic_expr (dump_file, pred->condition);
-	      fprintf (dump_file, "\n");
-	    }
+	  else if (dump_enabled_p ())
+	    dump_printf_loc (MSG_MISSED_OPTIMIZATION, loc,
+			     "Not unswitching condition, cost too big "
+			     "(%d insns)\n", cost);
 	}
     }
 
@@ -864,12 +861,10 @@ tree_unswitch_single_loop (class loop *loop, int num,
       if (!dbg_cnt (loop_unswitch))
 	goto exit;
 
-      if (dump_file && (dump_flags & TDF_DETAILS))
-	{
-	  fprintf (dump_file, ";; Unswitching loop on condition: ");
-	  print_generic_expr (dump_file, predicate->condition);
-	  fprintf (dump_file, "\n");
-	}
+      if (dump_enabled_p ())
+	dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc,
+			 "Unswitching loop on condition: %T\n",
+			 predicate->condition);
 
       predicate->handled = true;
       initialize_original_copy_tables ();


             reply	other threads:[~2021-12-09 12:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09 12:48 Martin Liska [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-12-08 18:26 Martin Liska
2021-12-08 10:17 Martin Liska
2021-12-07 16:50 Martin Liska

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211209124842.1B53E3858431@sourceware.org \
    --to=marxin@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).