From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38377 invoked by alias); 25 Jul 2018 10:04:49 -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 37858 invoked by uid 89); 25 Jul 2018 10:04:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.3 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=HX-Received:sk:63-v6mr X-HELO: mail-lf1-f44.google.com Received: from mail-lf1-f44.google.com (HELO mail-lf1-f44.google.com) (209.85.167.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 25 Jul 2018 10:04:47 +0000 Received: by mail-lf1-f44.google.com with SMTP id n96-v6so5026049lfi.1 for ; Wed, 25 Jul 2018 03:04:46 -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=6Ga5AXr4kjSs0xLsG+P/9RjBAvdSCLUg9hMLRsh2/c8=; b=ota6+cCO7ZRQJLv5rU7GJupNF32tqzdPA58koFlY1ELB4A8zIVBpKFkpKMImO+2CbE sfA0JCvh7cr8iIfzsyDxfpIy1vx9DW1ZsWr8f7J2kgUql3OCNc3LE818p/eDIbz6SBU+ EVkvYoO907q3pGivFx0oUUKF/m1APPCz5MKO4dJhvAu140JAQxTYxLGNEZ6A96RBvTQN IOGMuVytq3VcDTbZLSQNxeDJlwWS/ziHTZ9dkBpj5R2OFztkAfYW1K0ebNDM5CkZ9Dmz ntMxbdhWmDsLgT5KqHxCEOHywxhRsy6LZvD+HumwRJZCzYogtPVIL4BpSHK1vyDmVAdP jA2A== MIME-Version: 1.0 References: <87wotlrmen.fsf@arm.com> <87bmaxne4f.fsf@arm.com> In-Reply-To: <87bmaxne4f.fsf@arm.com> From: Richard Biener Date: Wed, 25 Jul 2018 10:04:00 -0000 Message-ID: Subject: Re: [30/46] Use stmt_vec_infos rather than gimple stmts for worklists To: GCC Patches , richard.sandiford@arm.com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg01498.txt.bz2 On Tue, Jul 24, 2018 at 12:05 PM Richard Sandiford wrote: > > 2018-07-24 Richard Sandiford > > gcc/ > * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Change the type > of the worklist from a vector of gimple stmts to a vector of > stmt_vec_infos. > * tree-vect-stmts.c (vect_mark_relevant, process_use) > (vect_mark_stmts_to_be_vectorized): Likewise OK > Index: gcc/tree-vect-loop.c > =================================================================== > --- gcc/tree-vect-loop.c 2018-07-24 10:23:38.964700191 +0100 > +++ gcc/tree-vect-loop.c 2018-07-24 10:23:42.472669038 +0100 > @@ -474,7 +474,7 @@ vect_analyze_scalar_cycles_1 (loop_vec_i > { > basic_block bb = loop->header; > tree init, step; > - auto_vec worklist; > + auto_vec worklist; > gphi_iterator gsi; > bool double_reduc; > > @@ -543,9 +543,9 @@ vect_analyze_scalar_cycles_1 (loop_vec_i > /* Second - identify all reductions and nested cycles. */ > while (worklist.length () > 0) > { > - gimple *phi = worklist.pop (); > + stmt_vec_info stmt_vinfo = worklist.pop (); > + gphi *phi = as_a (stmt_vinfo->stmt); > tree def = PHI_RESULT (phi); > - stmt_vec_info stmt_vinfo = vinfo_for_stmt (phi); > > if (dump_enabled_p ()) > { > Index: gcc/tree-vect-stmts.c > =================================================================== > --- gcc/tree-vect-stmts.c 2018-07-24 10:23:38.968700155 +0100 > +++ gcc/tree-vect-stmts.c 2018-07-24 10:23:42.472669038 +0100 > @@ -194,7 +194,7 @@ vect_clobber_variable (gimple *stmt, gim > Mark STMT as "relevant for vectorization" and add it to WORKLIST. */ > > static void > -vect_mark_relevant (vec *worklist, gimple *stmt, > +vect_mark_relevant (vec *worklist, gimple *stmt, > enum vect_relevant relevant, bool live_p) > { > stmt_vec_info stmt_info = vinfo_for_stmt (stmt); > @@ -453,7 +453,7 @@ exist_non_indexing_operands_for_use_p (t > > static bool > process_use (gimple *stmt, tree use, loop_vec_info loop_vinfo, > - enum vect_relevant relevant, vec *worklist, > + enum vect_relevant relevant, vec *worklist, > bool force) > { > stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt); > @@ -618,16 +618,14 @@ vect_mark_stmts_to_be_vectorized (loop_v > basic_block *bbs = LOOP_VINFO_BBS (loop_vinfo); > unsigned int nbbs = loop->num_nodes; > gimple_stmt_iterator si; > - gimple *stmt; > unsigned int i; > - stmt_vec_info stmt_vinfo; > basic_block bb; > bool live_p; > enum vect_relevant relevant; > > DUMP_VECT_SCOPE ("vect_mark_stmts_to_be_vectorized"); > > - auto_vec worklist; > + auto_vec worklist; > > /* 1. Init worklist. */ > for (i = 0; i < nbbs; i++) > @@ -665,17 +663,17 @@ vect_mark_stmts_to_be_vectorized (loop_v > use_operand_p use_p; > ssa_op_iter iter; > > - stmt = worklist.pop (); > + stmt_vec_info stmt_vinfo = worklist.pop (); > if (dump_enabled_p ()) > { > - dump_printf_loc (MSG_NOTE, vect_location, "worklist: examine stmt: "); > - dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0); > + dump_printf_loc (MSG_NOTE, vect_location, > + "worklist: examine stmt: "); > + dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt_vinfo->stmt, 0); > } > > /* Examine the USEs of STMT. For each USE, mark the stmt that defines it > (DEF_STMT) as relevant/irrelevant according to the relevance property > of STMT. */ > - stmt_vinfo = vinfo_for_stmt (stmt); > relevant = STMT_VINFO_RELEVANT (stmt_vinfo); > > /* Generally, the relevance property of STMT (in STMT_VINFO_RELEVANT) is