From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82309 invoked by alias); 31 Jul 2018 12:07:18 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 82212 invoked by uid 89); 31 Jul 2018 12:07:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Turn, sk:neutral X-HELO: mail-lj1-f172.google.com Received: from mail-lj1-f172.google.com (HELO mail-lj1-f172.google.com) (209.85.208.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 31 Jul 2018 12:07:16 +0000 Received: by mail-lj1-f172.google.com with SMTP id r13-v6so13492127ljg.10 for ; Tue, 31 Jul 2018 05:07:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=oCxrIkvlIc3rTJfgn6PpzhDNZ2/L1uJv6GdbLWekD44=; b=Zbei4jvngrUx9Wts0yqKUfgV15eq5pGy64hd83sBWs6ZfPSPvRglMZBx5w0W2lzJYy +mIgIUvKx+uO9ovinS5mm+TsUX7OjbO1xX8OK7MrT6GaSzUTD4Nsb0RuB18uMFzORymR Xbt7FLiNkh5Up55TazGV5SVTV2eZnjILZlTr1F/rALBMbZM3szi7OPV08CYRUVKO652I Ol8I0bLfzLVL6vXg/TTQABMmLd6JghWx8qa341O1v1/NjZrRuTblD1TcYnUTiZPJEZ7q xBuXP5TqzlDFz8p7Ghk6rT065y9UgxkG/zGhh3zKKKhLx6UJDsZPIYxHVZJRIq1ofRij enBQ== MIME-Version: 1.0 References: <87wotlrmen.fsf@arm.com> <87efftkkow.fsf@arm.com> In-Reply-To: <87efftkkow.fsf@arm.com> From: Richard Biener Date: Tue, 31 Jul 2018 12:07:00 -0000 Message-ID: Subject: Re: [46/46] Turn stmt_vec_info back into a typedef To: GCC Patches , richard.sandiford@arm.com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg01928.txt.bz2 On Tue, Jul 24, 2018 at 12:11 PM Richard Sandiford wrote: > > This patch removes the stmt_vec_info wrapper class added near the > beginning of the series and turns stmt_vec_info back into a typedef. > OK. For the whole series now if I didn't miss anything... Richard. > 2018-07-24 Richard Sandiford > > gcc/ > * tree-vectorizer.h (stmt_vec_info): Turn back into a typedef. > (NULL_STMT_VEC_INFO): Delete. > (stmt_vec_info::operator*): Likewise. > (stmt_vec_info::operator gimple *): Likewise. > * tree-vect-loop.c (vectorizable_reduction): Use NULL instead > of NULL_STMT_VEC_INFO. > * tree-vect-patterns.c (vect_init_pattern_stmt): Likewise. > (vect_reassociating_reduction_p): Likewise. > * tree-vect-stmts.c (vect_build_gather_load_calls): Likewise. > (vectorizable_store): Likewise. > * tree-vectorizer.c (vec_info::set_vinfo_for_stmt): Likewise. > (vec_info::free_stmt_vec_infos): Likewise. > > Index: gcc/tree-vectorizer.h > =================================================================== > --- gcc/tree-vectorizer.h 2018-07-24 10:24:32.472224947 +0100 > +++ gcc/tree-vectorizer.h 2018-07-24 10:24:35.888194598 +0100 > @@ -21,26 +21,7 @@ Software Foundation; either version 3, o > #ifndef GCC_TREE_VECTORIZER_H > #define GCC_TREE_VECTORIZER_H > > -class stmt_vec_info { > -public: > - stmt_vec_info () {} > - stmt_vec_info (struct _stmt_vec_info *ptr) : m_ptr (ptr) {} > - struct _stmt_vec_info *operator-> () const { return m_ptr; } > - struct _stmt_vec_info &operator* () const; > - operator struct _stmt_vec_info * () const { return m_ptr; } > - operator gimple * () const; > - operator void * () const { return m_ptr; } > - operator bool () const { return m_ptr; } > - bool operator == (const stmt_vec_info &x) { return x.m_ptr == m_ptr; } > - bool operator == (_stmt_vec_info *x) { return x == m_ptr; } > - bool operator != (const stmt_vec_info &x) { return x.m_ptr != m_ptr; } > - bool operator != (_stmt_vec_info *x) { return x != m_ptr; } > - > -private: > - struct _stmt_vec_info *m_ptr; > -}; > - > -#define NULL_STMT_VEC_INFO (stmt_vec_info (NULL)) > +typedef struct _stmt_vec_info *stmt_vec_info; > > #include "tree-data-ref.h" > #include "tree-hash-traits.h" > @@ -1080,17 +1061,6 @@ #define VECT_SCALAR_BOOLEAN_TYPE_P(TYPE) > && TYPE_PRECISION (TYPE) == 1 \ > && TYPE_UNSIGNED (TYPE))) > > -inline _stmt_vec_info & > -stmt_vec_info::operator* () const > -{ > - return *m_ptr; > -} > - > -inline stmt_vec_info::operator gimple * () const > -{ > - return m_ptr ? m_ptr->stmt : NULL; > -} > - > static inline bool > nested_in_vect_loop_p (struct loop *loop, stmt_vec_info stmt_info) > { > Index: gcc/tree-vect-loop.c > =================================================================== > --- gcc/tree-vect-loop.c 2018-07-24 10:24:29.296253164 +0100 > +++ gcc/tree-vect-loop.c 2018-07-24 10:24:35.884194634 +0100 > @@ -6755,7 +6755,7 @@ vectorizable_reduction (stmt_vec_info st > if (slp_node) > neutral_op = neutral_op_for_slp_reduction > (slp_node_instance->reduc_phis, code, > - REDUC_GROUP_FIRST_ELEMENT (stmt_info) != NULL_STMT_VEC_INFO); > + REDUC_GROUP_FIRST_ELEMENT (stmt_info) != NULL); > > if (double_reduc && reduction_type == FOLD_LEFT_REDUCTION) > { > Index: gcc/tree-vect-patterns.c > =================================================================== > --- gcc/tree-vect-patterns.c 2018-07-24 10:24:02.360492422 +0100 > +++ gcc/tree-vect-patterns.c 2018-07-24 10:24:35.884194634 +0100 > @@ -104,7 +104,7 @@ vect_init_pattern_stmt (gimple *pattern_ > { > vec_info *vinfo = orig_stmt_info->vinfo; > stmt_vec_info pattern_stmt_info = vinfo->lookup_stmt (pattern_stmt); > - if (pattern_stmt_info == NULL_STMT_VEC_INFO) > + if (pattern_stmt_info == NULL) > pattern_stmt_info = orig_stmt_info->vinfo->add_stmt (pattern_stmt); > gimple_set_bb (pattern_stmt, gimple_bb (orig_stmt_info->stmt)); > > @@ -819,7 +819,7 @@ vect_reassociating_reduction_p (stmt_vec > { > return (STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_reduction_def > ? STMT_VINFO_REDUC_TYPE (stmt_vinfo) != FOLD_LEFT_REDUCTION > - : REDUC_GROUP_FIRST_ELEMENT (stmt_vinfo) != NULL_STMT_VEC_INFO); > + : REDUC_GROUP_FIRST_ELEMENT (stmt_vinfo) != NULL); > } > > /* As above, but also require it to have code CODE and to be a reduction > Index: gcc/tree-vect-stmts.c > =================================================================== > --- gcc/tree-vect-stmts.c 2018-07-24 10:24:29.300253129 +0100 > +++ gcc/tree-vect-stmts.c 2018-07-24 10:24:35.888194598 +0100 > @@ -2842,7 +2842,7 @@ vect_build_gather_load_calls (stmt_vec_i > new_stmt_info = loop_vinfo->lookup_def (var); > } > > - if (prev_stmt_info == NULL_STMT_VEC_INFO) > + if (prev_stmt_info == NULL) > STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt_info; > else > STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt_info; > @@ -6574,7 +6574,7 @@ vectorizable_store (stmt_vec_info stmt_i > stmt_vec_info new_stmt_info > = vect_finish_stmt_generation (stmt_info, new_stmt, gsi); > > - if (prev_stmt_info == NULL_STMT_VEC_INFO) > + if (prev_stmt_info == NULL) > STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt_info; > else > STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt_info; > Index: gcc/tree-vectorizer.c > =================================================================== > --- gcc/tree-vectorizer.c 2018-07-24 10:24:32.472224947 +0100 > +++ gcc/tree-vectorizer.c 2018-07-24 10:24:35.888194598 +0100 > @@ -649,7 +649,7 @@ vec_info::set_vinfo_for_stmt (gimple *st > } > else > { > - gcc_checking_assert (info == NULL_STMT_VEC_INFO); > + gcc_checking_assert (info == NULL); > stmt_vec_infos[uid - 1] = info; > } > } > @@ -662,7 +662,7 @@ vec_info::free_stmt_vec_infos (void) > unsigned int i; > stmt_vec_info info; > FOR_EACH_VEC_ELT (stmt_vec_infos, i, info) > - if (info != NULL_STMT_VEC_INFO) > + if (info != NULL) > free_stmt_vec_info (info); > stmt_vec_infos.release (); > }