public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>, richard.sandiford@arm.com
Subject: Re: [33/46] Use stmt_vec_infos instead of vec_info/gimple stmt pairs
Date: Wed, 25 Jul 2018 10:06:00 -0000	[thread overview]
Message-ID: <CAFiYyc3HFW2WThHFiduZx0twJUnrktVsP7zSjWjKRSTWsFiAgw@mail.gmail.com> (raw)
In-Reply-To: <87y3e1lzhu.fsf@arm.com>

On Tue, Jul 24, 2018 at 12:06 PM Richard Sandiford
<richard.sandiford@arm.com> wrote:
>
> This patch makes vect_record_max_nunits and vect_record_base_alignment
> take a stmt_vec_info instead of a vec_info/gimple pair.

OK

>
> 2018-07-24  Richard Sandiford  <richard.sandiford@arm.com>
>
> gcc/
>         * tree-vect-data-refs.c (vect_record_base_alignment): Replace vec_info
>         and gimple stmt arguments with a stmt_vec_info.
>         (vect_record_base_alignments): Update calls accordingly.
>         * tree-vect-slp.c (vect_record_max_nunits): Replace vec_info
>         and gimple stmt arguments with a stmt_vec_info.
>         (vect_build_slp_tree_1): Remove vinfo argument and update call
>         to vect_record_max_nunits.
>         (vect_build_slp_tree_2): Update calls to vect_build_slp_tree_1
>         and vect_record_max_nunits.
>
> Index: gcc/tree-vect-data-refs.c
> ===================================================================
> --- gcc/tree-vect-data-refs.c   2018-07-24 10:23:50.000602186 +0100
> +++ gcc/tree-vect-data-refs.c   2018-07-24 10:23:53.204573732 +0100
> @@ -794,14 +794,14 @@ vect_slp_analyze_instance_dependence (sl
>    return res;
>  }
>
> -/* Record in VINFO the base alignment guarantee given by DRB.  STMT is
> -   the statement that contains DRB, which is useful for recording in the
> -   dump file.  */
> +/* Record the base alignment guarantee given by DRB, which occurs
> +   in STMT_INFO.  */
>
>  static void
> -vect_record_base_alignment (vec_info *vinfo, gimple *stmt,
> +vect_record_base_alignment (stmt_vec_info stmt_info,
>                             innermost_loop_behavior *drb)
>  {
> +  vec_info *vinfo = stmt_info->vinfo;
>    bool existed;
>    innermost_loop_behavior *&entry
>      = vinfo->base_alignments.get_or_insert (drb->base_address, &existed);
> @@ -820,7 +820,7 @@ vect_record_base_alignment (vec_info *vi
>                            "  misalignment: %d\n", drb->base_misalignment);
>           dump_printf_loc (MSG_NOTE, vect_location,
>                            "  based on:     ");
> -         dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
> +         dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt_info->stmt, 0);
>         }
>      }
>  }
> @@ -847,13 +847,13 @@ vect_record_base_alignments (vec_info *v
>           && STMT_VINFO_VECTORIZABLE (stmt_info)
>           && !STMT_VINFO_GATHER_SCATTER_P (stmt_info))
>         {
> -         vect_record_base_alignment (vinfo, stmt_info, &DR_INNERMOST (dr));
> +         vect_record_base_alignment (stmt_info, &DR_INNERMOST (dr));
>
>           /* If DR is nested in the loop that is being vectorized, we can also
>              record the alignment of the base wrt the outer loop.  */
>           if (loop && nested_in_vect_loop_p (loop, stmt_info))
>             vect_record_base_alignment
> -               (vinfo, stmt_info, &STMT_VINFO_DR_WRT_VEC_LOOP (stmt_info));
> +             (stmt_info, &STMT_VINFO_DR_WRT_VEC_LOOP (stmt_info));
>         }
>      }
>  }
> Index: gcc/tree-vect-slp.c
> ===================================================================
> --- gcc/tree-vect-slp.c 2018-07-24 10:23:50.004602150 +0100
> +++ gcc/tree-vect-slp.c 2018-07-24 10:23:53.204573732 +0100
> @@ -609,14 +609,14 @@ compatible_calls_p (gcall *call1, gcall
>  }
>
>  /* A subroutine of vect_build_slp_tree for checking VECTYPE, which is the
> -   caller's attempt to find the vector type in STMT with the narrowest
> +   caller's attempt to find the vector type in STMT_INFO with the narrowest
>     element type.  Return true if VECTYPE is nonnull and if it is valid
> -   for VINFO.  When returning true, update MAX_NUNITS to reflect the
> -   number of units in VECTYPE.  VINFO, GORUP_SIZE and MAX_NUNITS are
> -   as for vect_build_slp_tree.  */
> +   for STMT_INFO.  When returning true, update MAX_NUNITS to reflect the
> +   number of units in VECTYPE.  GROUP_SIZE and MAX_NUNITS are as for
> +   vect_build_slp_tree.  */
>
>  static bool
> -vect_record_max_nunits (vec_info *vinfo, gimple *stmt, unsigned int group_size,
> +vect_record_max_nunits (stmt_vec_info stmt_info, unsigned int group_size,
>                         tree vectype, poly_uint64 *max_nunits)
>  {
>    if (!vectype)
> @@ -625,7 +625,8 @@ vect_record_max_nunits (vec_info *vinfo,
>         {
>           dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
>                            "Build SLP failed: unsupported data-type in ");
> -         dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
> +         dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
> +                           stmt_info->stmt, 0);
>           dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
>         }
>        /* Fatal mismatch.  */
> @@ -636,7 +637,7 @@ vect_record_max_nunits (vec_info *vinfo,
>       before adjusting *max_nunits for basic-block vectorization.  */
>    poly_uint64 nunits = TYPE_VECTOR_SUBPARTS (vectype);
>    unsigned HOST_WIDE_INT const_nunits;
> -  if (is_a <bb_vec_info> (vinfo)
> +  if (STMT_VINFO_BB_VINFO (stmt_info)
>        && (!nunits.is_constant (&const_nunits)
>           || const_nunits > group_size))
>      {
> @@ -696,7 +697,7 @@ vect_two_operations_perm_ok_p (vec<stmt_
>     to (B1 <= A1 ? X1 : Y1); or be inverted to (A1 < B1) ? Y1 : X1.  */
>
>  static bool
> -vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
> +vect_build_slp_tree_1 (unsigned char *swap,
>                        vec<stmt_vec_info> stmts, unsigned int group_size,
>                        poly_uint64 *max_nunits, bool *matches,
>                        bool *two_operators)
> @@ -763,7 +764,7 @@ vect_build_slp_tree_1 (vec_info *vinfo,
>        if (!vect_get_vector_types_for_stmt (stmt_info, &vectype,
>                                            &nunits_vectype)
>           || (nunits_vectype
> -             && !vect_record_max_nunits (vinfo, stmt_info, group_size,
> +             && !vect_record_max_nunits (stmt_info, group_size,
>                                           nunits_vectype, max_nunits)))
>         {
>           /* Fatal mismatch.  */
> @@ -1207,8 +1208,7 @@ vect_build_slp_tree_2 (vec_info *vinfo,
>      {
>        tree scalar_type = TREE_TYPE (PHI_RESULT (stmt));
>        tree vectype = get_vectype_for_scalar_type (scalar_type);
> -      if (!vect_record_max_nunits (vinfo, stmt_info, group_size, vectype,
> -                                  max_nunits))
> +      if (!vect_record_max_nunits (stmt_info, group_size, vectype, max_nunits))
>         return NULL;
>
>        vect_def_type def_type = STMT_VINFO_DEF_TYPE (stmt_info);
> @@ -1241,7 +1241,7 @@ vect_build_slp_tree_2 (vec_info *vinfo,
>
>    bool two_operators = false;
>    unsigned char *swap = XALLOCAVEC (unsigned char, group_size);
> -  if (!vect_build_slp_tree_1 (vinfo, swap, stmts, group_size,
> +  if (!vect_build_slp_tree_1 (swap, stmts, group_size,
>                               &this_max_nunits, matches, &two_operators))
>      return NULL;
>

  reply	other threads:[~2018-07-25 10:06 UTC|newest]

Thread overview: 108+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-24  9:52 [00/46] Remove vinfo_for_stmt etc Richard Sandiford
2018-07-24  9:52 ` [01/46] Move special cases out of get_initial_def_for_reduction Richard Sandiford
2018-07-25  8:42   ` Richard Biener
2018-07-24  9:53 ` [02/46] Remove dead vectorizable_reduction code Richard Sandiford
2018-07-25  8:43   ` Richard Biener
2018-07-24  9:53 ` [03/46] Remove unnecessary update of NUM_SLP_USES Richard Sandiford
2018-07-25  8:46   ` Richard Biener
2018-07-24  9:54 ` [04/46] Factor out the test for a valid reduction input Richard Sandiford
2018-07-25  8:46   ` Richard Biener
2018-07-24  9:54 ` [05/46] Fix make_ssa_name call in vectorizable_reduction Richard Sandiford
2018-07-25  8:47   ` Richard Biener
2018-07-24  9:55 ` [06/46] Add vec_info::add_stmt Richard Sandiford
2018-07-25  9:10   ` Richard Biener
2018-07-24  9:55 ` [08/46] Add vec_info::lookup_def Richard Sandiford
2018-07-25  9:12   ` Richard Biener
2018-07-24  9:55 ` [07/46] Add vec_info::lookup_stmt Richard Sandiford
2018-07-25  9:11   ` Richard Biener
2018-07-24  9:56 ` [09/46] Add vec_info::lookup_single_use Richard Sandiford
2018-07-25  9:13   ` Richard Biener
2018-07-24  9:57 ` [11/46] Pass back a stmt_vec_info from vect_is_simple_use Richard Sandiford
2018-07-25  9:18   ` Richard Biener
2018-07-24  9:57 ` [10/46] Temporarily make stmt_vec_info a class Richard Sandiford
2018-07-25  9:14   ` Richard Biener
2018-07-24  9:58 ` [14/46] Make STMT_VINFO_VEC_STMT a stmt_vec_info Richard Sandiford
2018-07-25  9:21   ` Richard Biener
2018-07-25 11:03     ` Richard Sandiford
2018-08-02  0:22   ` H.J. Lu
2018-08-02  9:58     ` Richard Sandiford
2018-07-24  9:58 ` [13/46] Make STMT_VINFO_RELATED_STMT " Richard Sandiford
2018-07-25  9:19   ` Richard Biener
2018-07-24  9:58 ` [12/46] Make vect_finish_stmt_generation return " Richard Sandiford
2018-07-25  9:19   ` Richard Biener
2018-07-24  9:59 ` [15/46] Make SLP_TREE_VEC_STMTS a vec<stmt_vec_info> Richard Sandiford
2018-07-25  9:22   ` Richard Biener
2018-07-24  9:59 ` [16/46] Make STMT_VINFO_REDUC_DEF a stmt_vec_info Richard Sandiford
2018-07-25  9:22   ` Richard Biener
2018-07-24  9:59 ` [17/46] Make LOOP_VINFO_REDUCTIONS an auto_vec<stmt_vec_info> Richard Sandiford
2018-07-25  9:23   ` Richard Biener
2018-07-24 10:00 ` [18/46] Make SLP_TREE_SCALAR_STMTS a vec<stmt_vec_info> Richard Sandiford
2018-07-25  9:27   ` Richard Biener
2018-07-31 15:03     ` Richard Sandiford
2018-07-24 10:01 ` [19/46] Make vect_dr_stmt return a stmt_vec_info Richard Sandiford
2018-07-25  9:28   ` Richard Biener
2018-07-24 10:01 ` [21/46] Make grouped_stores and reduction_chains use stmt_vec_infos Richard Sandiford
2018-07-25  9:28   ` Richard Biener
2018-07-24 10:01 ` [20/46] Make *FIRST_ELEMENT and *NEXT_ELEMENT stmt_vec_infos Richard Sandiford
2018-07-25  9:28   ` Richard Biener
2018-07-24 10:02 ` [23/46] Make LOOP_VINFO_MAY_MISALIGN_STMTS use stmt_vec_info Richard Sandiford
2018-07-25  9:29   ` Richard Biener
2018-07-24 10:02 ` [22/46] Make DR_GROUP_SAME_DR_STMT a stmt_vec_info Richard Sandiford
2018-07-25  9:29   ` Richard Biener
2018-07-24 10:02 ` [24/46] Make stmt_info_for_cost use " Richard Sandiford
2018-07-25  9:30   ` Richard Biener
2018-07-24 10:03 ` [27/46] Remove duplicated stmt_vec_info lookups Richard Sandiford
2018-07-25  9:32   ` Richard Biener
2018-07-24 10:03 ` [25/46] Make get_earlier/later_stmt take and return stmt_vec_infos Richard Sandiford
2018-07-25  9:31   ` Richard Biener
2018-07-24 10:03 ` [26/46] Make more use of dyn_cast in tree-vect* Richard Sandiford
2018-07-25  9:31   ` Richard Biener
2018-07-24 10:04 ` [28/46] Use stmt_vec_info instead of gimple stmts internally (part 1) Richard Sandiford
2018-07-25  9:33   ` Richard Biener
2018-07-24 10:04 ` [30/46] Use stmt_vec_infos rather than gimple stmts for worklists Richard Sandiford
2018-07-25 10:04   ` Richard Biener
2018-07-24 10:04 ` [29/46] Use stmt_vec_info instead of gimple stmts internally (part 2) Richard Sandiford
2018-07-25 10:03   ` Richard Biener
2018-07-24 10:05 ` [31/46] Use stmt_vec_info in function interfaces (part 1) Richard Sandiford
2018-07-25 10:05   ` Richard Biener
2018-07-24 10:05 ` [32/46] Use stmt_vec_info in function interfaces (part 2) Richard Sandiford
2018-07-25 10:06   ` Richard Biener
2018-07-24 10:06 ` [33/46] Use stmt_vec_infos instead of vec_info/gimple stmt pairs Richard Sandiford
2018-07-25 10:06   ` Richard Biener [this message]
2018-07-24 10:06 ` [35/46] Alter interfaces within vect_pattern_recog Richard Sandiford
2018-07-25 10:14   ` Richard Biener
2018-07-24 10:06 ` [34/46] Alter interface to vect_get_vec_def_for_stmt_copy Richard Sandiford
2018-07-25 10:13   ` Richard Biener
2018-07-24 10:07 ` [37/46] Associate alignment information with stmt_vec_infos Richard Sandiford
2018-07-25 10:18   ` Richard Biener
2018-07-26 10:55     ` Richard Sandiford
2018-07-26 11:13       ` Richard Biener
2018-07-24 10:07 ` [36/46] Add a pattern_stmt_p field to stmt_vec_info Richard Sandiford
2018-07-25 10:15   ` Richard Biener
2018-07-25 11:09     ` Richard Sandiford
2018-07-25 11:48       ` Richard Biener
2018-07-26 10:29         ` Richard Sandiford
2018-07-26 11:15           ` Richard Biener
2018-07-24 10:08 ` [39/46] Replace STMT_VINFO_UNALIGNED_DR with the associated statement Richard Sandiford
2018-07-26 11:08   ` [39/46 v2] Change STMT_VINFO_UNALIGNED_DR to a dr_vec_info Richard Sandiford
2018-07-26 11:13     ` Richard Biener
2018-07-24 10:08 ` [38/46] Pass stmt_vec_infos instead of data_references where relevant Richard Sandiford
2018-07-25 10:21   ` Richard Biener
2018-07-25 11:21     ` Richard Sandiford
2018-07-26 11:05       ` Richard Sandiford
2018-07-26 11:13         ` Richard Biener
2018-07-24 10:09 ` [42/46] Add vec_info::replace_stmt Richard Sandiford
2018-07-31 12:03   ` Richard Biener
2018-07-24 10:09 ` [41/46] Add vec_info::remove_stmt Richard Sandiford
2018-07-31 12:02   ` Richard Biener
2018-07-24 10:09 ` [40/46] Add vec_info::lookup_dr Richard Sandiford
2018-07-26 11:10   ` [40/46 v2] " Richard Sandiford
2018-07-26 11:16     ` Richard Biener
2018-07-24 10:10 ` [44/46] Remove global vinfo_for_stmt-related routines Richard Sandiford
2018-07-31 12:05   ` Richard Biener
2018-07-24 10:10 ` [43/46] Make free_stmt_vec_info take a stmt_vec_info Richard Sandiford
2018-07-31 12:03   ` Richard Biener
2018-07-24 10:10 ` [45/46] Remove vect_stmt_in_region_p Richard Sandiford
2018-07-31 12:06   ` Richard Biener
2018-07-24 10:11 ` [46/46] Turn stmt_vec_info back into a typedef Richard Sandiford
2018-07-31 12:07   ` Richard Biener

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=CAFiYyc3HFW2WThHFiduZx0twJUnrktVsP7zSjWjKRSTWsFiAgw@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.sandiford@arm.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).