public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: Jeff Law <law@redhat.com>, Richard Biener <richard.guenther@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 2/8] Introduce VECT_SCOPE macro
Date: Mon, 18 Jun 2018 19:07:00 -0000	[thread overview]
Message-ID: <1529348815.23999.102.camel@redhat.com> (raw)
In-Reply-To: <0e86c8aa-2688-d195-5cd9-7ceedb6dede1@redhat.com>

On Fri, 2018-06-15 at 14:11 -0600, Jeff Law wrote:
> On 06/14/2018 02:32 PM, David Malcolm wrote:
> > The vectorizer code has numerous instances of:
> > 
> >   if (dump_enabled_p ())
> >     dump_printf_loc (MSG_NOTE, vect_location,
> >                      "=== some message ===\n");
> > 
> > In each case, the dump_printf_loc is a MSG_NODE at vect_location.
> > 
> > In almost all cases the message is of the form
> >   "=== foo ===\n"
> > 
> > The exceptions are:
> >   "===== analyze_loop_nest =====\n"
> > which uses 4 equal signs rather than 3, and
> >   "===vect_slp_analyze_bb===\n"
> > which is missing the spaces.
> > 
> > In most cases (but not always) the message matches the function
> > name.
> > 
> > This patch replaces all of these with a macro, taking the message
> > as an argument (and forcing the use of three dashes and a space).
> > 
> > The idea is to later convert this macro to use an RAII type
> > that pushes and pops scope, so that the nesting structure appears
> > in the dumpfile and -fopt-info logs (and in the remarks and
> > optimization records introduced later in this patch kit).
> > 
> > The message is usually the function name, but not always.
> > Should I split this out into two macros? e.g. a VECT_FUNCTION_SCOPE
> > that uses __FUNCTION__?
> > 
> > Would DUMP_VECT_SCOPE be a better name, perhaps?
> > 
> > gcc/ChangeLog:
> > 	* tree-vect-data-refs.c (vect_analyze_data_ref_dependences):
> > 	Replace dump_printf_loc call with VECT_SCOPE.
> > 	(vect_slp_analyze_instance_dependence): Likewise.
> > 	(vect_enhance_data_refs_alignment): Likewise.
> > 	(vect_analyze_data_refs_alignment): Likewise.
> > 	(vect_slp_analyze_and_verify_instance_alignment
> > 	(vect_analyze_data_ref_accesses): Likewise.
> > 	(vect_prune_runtime_alias_test_list): Likewise.
> > 	(vect_analyze_data_refs): Likewise.
> > 	* tree-vect-loop-manip.c (vect_update_inits_of_drs): Likewise.
> > 	* tree-vect-loop.c (vect_determine_vectorization_factor):
> > Likewise.
> > 	(vect_analyze_scalar_cycles_1): Likewise.
> > 	(vect_get_loop_niters): Likewise.
> > 	(vect_analyze_loop_form_1): Likewise.
> > 	(vect_update_vf_for_slp): Likewise.
> > 	(vect_analyze_loop_operations): Likewise.
> > 	(vect_analyze_loop): Likewise.
> > 	(vectorizable_induction): Likewise.
> > 	(vect_transform_loop): Likewise.
> > 	* tree-vect-patterns.c (vect_pattern_recog): Likewise.
> > 	* tree-vect-slp.c (vect_analyze_slp): Likewise.
> > 	(vect_make_slp_decision): Likewise.
> > 	(vect_detect_hybrid_slp): Likewise.
> > 	(vect_slp_analyze_operations): Likewise.
> > 	(vect_slp_bb): Likewise.
> > 	* tree-vect-stmts.c (vect_mark_stmts_to_be_vectorized):
> > Likewise.
> > 	(vectorizable_bswap): Likewise.
> > 	(vectorizable_call): Likewise.
> > 	(vectorizable_simd_clone_call): Likewise.
> > 	(vectorizable_conversion): Likewise.
> > 	(vectorizable_assignment): Likewise.
> > 	(vectorizable_shift): Likewise.
> > 	(vectorizable_operation): Likewise.
> > 	* tree-vectorizer.h (VECT_SCOPE): New macro.
> 
> OK.  But rather than using a macro, *consider* just using a normal
> function.  I'm less and less inclined to use macros as I get older :-
> )
> 
> If there's a solid reason to use a macro, then that's fine.

The reason for doing it as a macro is that I'm planning to turn this
into an RAII-style class for pushing and popping scopes, capturing the
nesting.  That wouldn't work if it was a function.

> DUMP_VECT_SCOPE seems better than VEC_SCOPE.

Thanks.  I've committed the DUMP_VECT_SCOPE version of the patch as
r261710 (after usual testing)

Dave

  parent reply	other threads:[~2018-06-18 19:07 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-29 20:32 [PATCH 00/10] RFC: Prototype of compiler-assisted performance analysis David Malcolm
2018-05-29 20:32 ` [PATCH 02/10] Add JSON implementation David Malcolm
2018-05-30 17:31   ` Eric Gallager
2018-05-30 17:32     ` David Malcolm
2018-05-30 21:23       ` Eric Gallager
2018-05-29 20:32 ` [PATCH 10/10] Experiment with optinfo in tree-ssa-loop-im.c David Malcolm
2018-05-29 20:32 ` [PATCH 05/10] Experiment with using optinfo for vectorization David Malcolm
2018-05-29 20:32 ` [PATCH 09/10] Experiment with using optinfo in gimple-loop-interchange.cc David Malcolm
2018-06-01  9:51   ` Richard Biener
2018-06-01 13:40     ` David Malcolm
2018-06-01 15:32       ` Richard Biener
2018-06-01 22:22         ` David Malcolm
2018-06-04 13:20           ` Richard Biener
2018-06-14 19:50             ` [PATCH 0/8] v2 of optimization records patch kit David Malcolm
2018-06-14 19:50               ` [PATCH 8/8] Add lots of pointless churn to tree-vect-*.c David Malcolm
2018-06-14 19:50               ` [PATCH 7/8] tree-ssa-loop-im.c port from fprintf to the dump API David Malcolm
2018-06-14 19:50               ` [PATCH 4/8] tree-vect-loop.c: use MSG_OPTIMIZED_LOCATIONS in a few places David Malcolm
2018-06-14 19:50               ` [PATCH 6/8] ipa-inline.c/tree-inline.c: port from fprintf to dump API David Malcolm
2018-06-14 19:50               ` [PATCH 3/8] v2 of optinfo, remarks and optimization records David Malcolm
2018-06-14 19:50               ` [PATCH 2/8] Introduce VECT_SCOPE macro David Malcolm
2018-06-15 20:11                 ` Jeff Law
2018-06-18  9:26                   ` Richard Biener
2018-06-18 19:07                   ` David Malcolm [this message]
2018-06-14 19:50               ` [PATCH 1/8] Add GCC_LIKELY and GCC_UNLIKELY David Malcolm
2018-06-15  6:10                 ` Alexander Monakov
2018-06-15 16:31                 ` Jeff Law
2018-06-15 16:35                   ` Jakub Jelinek
2018-06-15 16:36                     ` Jeff Law
2018-06-15 20:04                       ` David Malcolm
2018-06-14 19:50               ` [PATCH 5/8] gimple-loop-interchange.cc: use the dump API in a few places David Malcolm
2018-06-20 16:35             ` [PATCH] v3 of optinfo, remarks and optimization records David Malcolm
2018-06-25 13:35               ` Richard Biener
2018-06-26 13:54                 ` [committed] Introduce dump_location_t David Malcolm
2018-06-28 11:29                   ` Richard Biener
2018-06-28 14:29                     ` David Malcolm
2018-06-29  7:14                       ` Richard Biener
2018-07-02 20:51                         ` [PATCH 0/2] v4: optinfo framework and remarks David Malcolm
2018-07-02 20:51                           ` [PATCH 2/2] optinfo: add diagnostic remarks David Malcolm
2018-07-09 13:05                             ` Richard Biener
2018-07-11 10:53                               ` [PATCH 1/2] v5: Add "optinfo" framework David Malcolm
2018-07-11 10:53                                 ` [PATCH 2/2] Add "-fsave-optimization-record" David Malcolm
2018-07-19 12:39                                   ` Richard Biener
2018-07-20 15:45                                     ` David Malcolm
2018-07-18 20:20                                 ` [PING] Re: [PATCH 1/2] v5: Add "optinfo" framework David Malcolm
2018-07-19 12:18                                 ` Richard Biener
2018-07-02 20:51                           ` [PATCH 1/2] " David Malcolm
2018-07-09 13:01                             ` Richard Biener
2018-07-10 11:01                               ` David Malcolm
2018-07-10 11:25                                 ` Richard Biener
2018-06-26 15:43                 ` [PATCH] -fopt-info: add indentation via DUMP_VECT_SCOPE David Malcolm
2018-06-29  8:13                   ` Richard Biener
2018-07-02 12:25                     ` Christophe Lyon
2018-07-02 17:00                       ` David Malcolm
2018-07-02 17:09                         ` Christophe Lyon
2018-07-03  7:37                         ` Richard Biener
2018-07-03 13:52                           ` David Malcolm
2018-07-03 13:53                             ` Richard Biener
2018-07-03 14:10                               ` [PATCH] Remove "note: " prefix from some scan-tree-dump directives David Malcolm
2018-07-03 14:11                                 ` Richard Biener
2018-07-09  9:03                                   ` Christophe Lyon
2018-07-05  8:42                               ` [PATCH] -fopt-info: add indentation via DUMP_VECT_SCOPE Christophe Lyon
2018-07-05  9:03                                 ` Richard Biener
2018-06-26 20:27                 ` [PATCH] Hide alt_dump_file within dumpfile.c David Malcolm
2018-06-28  9:50                   ` Richard Biener
2018-05-29 20:32 ` [PATCH 03/10] Add optinfo, remarks and optimization records David Malcolm
2018-05-29 20:32 ` [PATCH 07/10] Experiment with using optinfo for loop-handling David Malcolm
2018-05-29 20:32 ` [PATCH 06/10] Experiments with using optinfo for inlining David Malcolm
2018-05-29 20:32 ` [PATCH 08/10] Experiment with using optinfo for devirtualization David Malcolm
2018-05-29 20:32 ` [PATCH 04/10] Use indentation to show nesting for -fopt-info David Malcolm
2018-05-29 20:35 ` [PATCH 01/10] Convert dump and optgroup flags to enums David Malcolm
2018-06-01 10:00   ` Richard Biener
2018-06-05  8:44     ` Trevor Saunders
2018-06-05 14:49       ` Sharing gdb's enum-flags.h with gcc? (was Re: [PATCH 01/10] Convert dump and optgroup flags to enums) David Malcolm
2018-06-05 16:13         ` Pedro Alves
2018-06-05 17:13           ` [PATCH (for gdb)] enum-flags.h: Add trailing semicolon to example in comment David Malcolm
2018-06-05 17:32             ` Pedro Alves
2018-06-06 12:54               ` David Malcolm
2018-06-06  0:48             ` Eric Gallager
2018-06-05 16:17         ` Sharing gdb's enum-flags.h with gcc? (was Re: [PATCH 01/10] Convert dump and optgroup flags to enums) Richard Biener
2018-06-08 12:59           ` [committed] v2: Convert dump and optgroup flags to enums David Malcolm

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=1529348815.23999.102.camel@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=richard.guenther@gmail.com \
    /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).