From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61673 invoked by alias); 24 Jul 2018 10:01:38 -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 61286 invoked by uid 89); 24 Jul 2018 10:01:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: foss.arm.com Received: from usa-sjc-mx-foss1.foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 24 Jul 2018 10:01:31 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7A4807A9 for ; Tue, 24 Jul 2018 03:01:29 -0700 (PDT) Received: from localhost (unknown [10.32.99.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 032DA3F237 for ; Tue, 24 Jul 2018 03:01:28 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [21/46] Make grouped_stores and reduction_chains use stmt_vec_infos References: <87wotlrmen.fsf@arm.com> Date: Tue, 24 Jul 2018 10:01:00 -0000 In-Reply-To: <87wotlrmen.fsf@arm.com> (Richard Sandiford's message of "Tue, 24 Jul 2018 10:52:16 +0100") Message-ID: <87efftosug.fsf@arm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-07/txt/msg01330.txt.bz2 This patch changes the SLP lists grouped_stores and reduction_chains from auto_vec to auto_vec. It was easier to do them together due to the way vect_analyze_slp is structured. 2018-07-24 Richard Sandiford gcc/ * tree-vectorizer.h (vec_info::grouped_stores): Change from an auto_vec to an auto_vec. (_loop_vec_info::reduction_chains): Likewise. * tree-vect-loop.c (vect_fixup_scalar_cycles_with_patterns): Update accordingly. * tree-vect-slp.c (vect_analyze_slp): Likewise. Index: gcc/tree-vectorizer.h =================================================================== --- gcc/tree-vectorizer.h 2018-07-24 10:23:08.536970400 +0100 +++ gcc/tree-vectorizer.h 2018-07-24 10:23:12.060939107 +0100 @@ -259,7 +259,7 @@ struct vec_info { /* All interleaving chains of stores, represented by the first stmt in the chain. */ - auto_vec grouped_stores; + auto_vec grouped_stores; /* Cost data used by the target cost model. */ void *target_cost_data; @@ -479,7 +479,7 @@ typedef struct _loop_vec_info : public v /* All reduction chains in the loop, represented by the first stmt in the chain. */ - auto_vec reduction_chains; + auto_vec reduction_chains; /* Cost vector for a single scalar iteration. */ auto_vec scalar_cost_vec; Index: gcc/tree-vect-loop.c =================================================================== --- gcc/tree-vect-loop.c 2018-07-24 10:23:08.532970436 +0100 +++ gcc/tree-vect-loop.c 2018-07-24 10:23:12.060939107 +0100 @@ -677,13 +677,13 @@ vect_fixup_reduc_chain (gimple *stmt) static void vect_fixup_scalar_cycles_with_patterns (loop_vec_info loop_vinfo) { - gimple *first; + stmt_vec_info first; unsigned i; FOR_EACH_VEC_ELT (LOOP_VINFO_REDUCTION_CHAINS (loop_vinfo), i, first) - if (STMT_VINFO_IN_PATTERN_P (vinfo_for_stmt (first))) + if (STMT_VINFO_IN_PATTERN_P (first)) { - stmt_vec_info next = REDUC_GROUP_NEXT_ELEMENT (vinfo_for_stmt (first)); + stmt_vec_info next = REDUC_GROUP_NEXT_ELEMENT (first); while (next) { if (! STMT_VINFO_IN_PATTERN_P (next)) @@ -696,7 +696,7 @@ vect_fixup_scalar_cycles_with_patterns ( { vect_fixup_reduc_chain (first); LOOP_VINFO_REDUCTION_CHAINS (loop_vinfo)[i] - = STMT_VINFO_RELATED_STMT (vinfo_for_stmt (first)); + = STMT_VINFO_RELATED_STMT (first); } } } Index: gcc/tree-vect-slp.c =================================================================== --- gcc/tree-vect-slp.c 2018-07-24 10:23:08.536970400 +0100 +++ gcc/tree-vect-slp.c 2018-07-24 10:23:12.060939107 +0100 @@ -2202,7 +2202,7 @@ vect_analyze_slp_instance (vec_info *vin vect_analyze_slp (vec_info *vinfo, unsigned max_tree_size) { unsigned int i; - gimple *first_element; + stmt_vec_info first_element; DUMP_VECT_SCOPE ("vect_analyze_slp"); @@ -2220,17 +2220,15 @@ vect_analyze_slp (vec_info *vinfo, unsig max_tree_size)) { /* Dissolve reduction chain group. */ - gimple *stmt = first_element; - while (stmt) + stmt_vec_info vinfo = first_element; + while (vinfo) { - stmt_vec_info vinfo = vinfo_for_stmt (stmt); stmt_vec_info next = REDUC_GROUP_NEXT_ELEMENT (vinfo); REDUC_GROUP_FIRST_ELEMENT (vinfo) = NULL; REDUC_GROUP_NEXT_ELEMENT (vinfo) = NULL; - stmt = next; + vinfo = next; } - STMT_VINFO_DEF_TYPE (vinfo_for_stmt (first_element)) - = vect_internal_def; + STMT_VINFO_DEF_TYPE (first_element) = vect_internal_def; } }