From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119159 invoked by alias); 30 Jul 2018 11:42: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 119146 invoked by uid 89); 30 Jul 2018 11:42:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,SPF_PASS autolearn=ham version=3.3.2 spammy=constructing, 834851, visit 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; Mon, 30 Jul 2018 11:42:36 +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 CB0B7ED1 for ; Mon, 30 Jul 2018 04:42:34 -0700 (PDT) Received: from localhost (unknown [10.32.98.51]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 53AEA3F802 for ; Mon, 30 Jul 2018 04:42:34 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [07/11] Use single basic block array in loop_vec_info References: <874lghez1a.fsf@arm.com> Date: Mon, 30 Jul 2018 11:42:00 -0000 In-Reply-To: <874lghez1a.fsf@arm.com> (Richard Sandiford's message of "Mon, 30 Jul 2018 12:36:01 +0100") Message-ID: <87a7q9dk5z.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/msg01828.txt.bz2 _loop_vec_info::_loop_vec_info used get_loop_array to get the order of the blocks when creating stmt_vec_infos, but then used dfs_enumerate_from to get the order of the blocks that the rest of the vectoriser uses. We should be able to use that order for creating stmt_vec_infos too. 2018-07-30 Richard Sandiford gcc/ * tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Use the result of dfs_enumerate_from when constructing stmt_vec_infos, instead of additionally calling get_loop_body. Index: gcc/tree-vect-loop.c =================================================================== *** gcc/tree-vect-loop.c 2018-07-30 12:40:59.366015643 +0100 --- gcc/tree-vect-loop.c 2018-07-30 12:40:59.362015678 +0100 *************** _loop_vec_info::_loop_vec_info (struct l *** 834,844 **** scalar_loop (NULL), orig_loop_info (NULL) { ! /* Create/Update stmt_info for all stmts in the loop. */ ! basic_block *body = get_loop_body (loop); ! for (unsigned int i = 0; i < loop->num_nodes; i++) { ! basic_block bb = body[i]; gimple_stmt_iterator si; for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si)) --- 834,851 ---- scalar_loop (NULL), orig_loop_info (NULL) { ! /* CHECKME: We want to visit all BBs before their successors (except for ! latch blocks, for which this assertion wouldn't hold). In the simple ! case of the loop forms we allow, a dfs order of the BBs would the same ! as reversed postorder traversal, so we are safe. */ ! ! unsigned int nbbs = dfs_enumerate_from (loop->header, 0, bb_in_loop_p, ! bbs, loop->num_nodes, loop); ! gcc_assert (nbbs == loop->num_nodes); ! ! for (unsigned int i = 0; i < nbbs; i++) { ! basic_block bb = bbs[i]; gimple_stmt_iterator si; for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si)) *************** _loop_vec_info::_loop_vec_info (struct l *** 855,870 **** add_stmt (stmt); } } - free (body); - - /* CHECKME: We want to visit all BBs before their successors (except for - latch blocks, for which this assertion wouldn't hold). In the simple - case of the loop forms we allow, a dfs order of the BBs would the same - as reversed postorder traversal, so we are safe. */ - - unsigned int nbbs = dfs_enumerate_from (loop->header, 0, bb_in_loop_p, - bbs, loop->num_nodes, loop); - gcc_assert (nbbs == loop->num_nodes); } /* Free all levels of MASKS. */ --- 862,867 ----