From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 65763 invoked by alias); 24 Jul 2018 10:02:24 -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 65741 invoked by uid 89); 24 Jul 2018 10:02:23 -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:02:22 +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 2CA0E7A9 for ; Tue, 24 Jul 2018 03:02:21 -0700 (PDT) Received: from localhost (unknown [10.32.99.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A99B73F237 for ; Tue, 24 Jul 2018 03:02:20 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [23/46] Make LOOP_VINFO_MAY_MISALIGN_STMTS use stmt_vec_info References: <87wotlrmen.fsf@arm.com> Date: Tue, 24 Jul 2018 10:02:00 -0000 In-Reply-To: <87wotlrmen.fsf@arm.com> (Richard Sandiford's message of "Tue, 24 Jul 2018 10:52:16 +0100") Message-ID: <876015ost0.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/msg01332.txt.bz2 This patch changes LOOP_VINFO_MAY_MISALIGN_STMTS from an auto_vec to an auto_vec. 2018-07-24 Richard Sandiford gcc/ * tree-vectorizer.h (_loop_vec_info::may_misalign_stmts): Change from an auto_vec to an auto_vec. * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Update accordingly. * tree-vect-loop-manip.c (vect_create_cond_for_align_checks): Likewise. Index: gcc/tree-vectorizer.h =================================================================== --- gcc/tree-vectorizer.h 2018-07-24 10:23:15.756906285 +0100 +++ gcc/tree-vectorizer.h 2018-07-24 10:23:18.856878757 +0100 @@ -472,7 +472,7 @@ typedef struct _loop_vec_info : public v /* Statements in the loop that have data references that are candidates for a runtime (loop versioning) misalignment check. */ - auto_vec may_misalign_stmts; + auto_vec may_misalign_stmts; /* Reduction cycles detected in the loop. Used in loop-aware SLP. */ auto_vec reductions; Index: gcc/tree-vect-data-refs.c =================================================================== --- gcc/tree-vect-data-refs.c 2018-07-24 10:23:08.532970436 +0100 +++ gcc/tree-vect-data-refs.c 2018-07-24 10:23:18.856878757 +0100 @@ -2231,16 +2231,15 @@ vect_enhance_data_refs_alignment (loop_v if (do_versioning) { - vec may_misalign_stmts + vec may_misalign_stmts = LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo); - gimple *stmt; + stmt_vec_info stmt_info; /* It can now be assumed that the data references in the statements in LOOP_VINFO_MAY_MISALIGN_STMTS will be aligned in the version of the loop being vectorized. */ - FOR_EACH_VEC_ELT (may_misalign_stmts, i, stmt) + FOR_EACH_VEC_ELT (may_misalign_stmts, i, stmt_info) { - stmt_vec_info stmt_info = vinfo_for_stmt (stmt); dr = STMT_VINFO_DATA_REF (stmt_info); SET_DR_MISALIGNMENT (dr, 0); if (dump_enabled_p ()) Index: gcc/tree-vect-loop-manip.c =================================================================== --- gcc/tree-vect-loop-manip.c 2018-07-24 10:23:04.029010432 +0100 +++ gcc/tree-vect-loop-manip.c 2018-07-24 10:23:18.856878757 +0100 @@ -2772,9 +2772,9 @@ vect_create_cond_for_align_checks (loop_ tree *cond_expr, gimple_seq *cond_expr_stmt_list) { - vec may_misalign_stmts + vec may_misalign_stmts = LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo); - gimple *ref_stmt; + stmt_vec_info stmt_info; int mask = LOOP_VINFO_PTR_MASK (loop_vinfo); tree mask_cst; unsigned int i; @@ -2795,23 +2795,22 @@ vect_create_cond_for_align_checks (loop_ /* Create expression (mask & (dr_1 || ... || dr_n)) where dr_i is the address of the first vector of the i'th data reference. */ - FOR_EACH_VEC_ELT (may_misalign_stmts, i, ref_stmt) + FOR_EACH_VEC_ELT (may_misalign_stmts, i, stmt_info) { gimple_seq new_stmt_list = NULL; tree addr_base; tree addr_tmp_name; tree new_or_tmp_name; gimple *addr_stmt, *or_stmt; - stmt_vec_info stmt_vinfo = vinfo_for_stmt (ref_stmt); - tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo); + tree vectype = STMT_VINFO_VECTYPE (stmt_info); bool negative = tree_int_cst_compare - (DR_STEP (STMT_VINFO_DATA_REF (stmt_vinfo)), size_zero_node) < 0; + (DR_STEP (STMT_VINFO_DATA_REF (stmt_info)), size_zero_node) < 0; tree offset = negative ? size_int (-TYPE_VECTOR_SUBPARTS (vectype) + 1) : size_zero_node; /* create: addr_tmp = (int)(address_of_first_vector) */ addr_base = - vect_create_addr_base_for_vector_ref (ref_stmt, &new_stmt_list, + vect_create_addr_base_for_vector_ref (stmt_info, &new_stmt_list, offset); if (new_stmt_list != NULL) gimple_seq_add_seq (cond_expr_stmt_list, new_stmt_list);