From patchwork Tue Jul 24 10:04:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 948316 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-482142-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Ehc9Yker"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41ZYrM22SLz9ryt for ; Tue, 24 Jul 2018 20:05:07 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=default; b=GkM/KbyRJJboYAk9mHzu/NPPnoMk/ pgt2BusXqqq6kRTvM677A87zYjVLw02iFTqZQjwx/Cq34p48yrGaJtyKJt9Eh08K 4RWn6zSxrVrnkEEnOcUouKHJIDXFQ/ktRb5jKxTrKVxONBOiTZxPVnxgyFOapNCb oE2/1LiJU42HNk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:references:date:in-reply-to:message-id:mime-version :content-type; s=default; bh=Xk6Ro5Ftj32Q2k9b4SoQlVfbwPA=; b=Ehc 9YkervIQJ27Nk+y6Ss5p/Jg/ahDOxnClfAInyCuk62HyWpZsVBQ7rS0YttGFEqcl uIQIb3VJdmlbb35zxts+0Jy3VNeGzLGn4syfq93lgNbTW7Y8H2ZUBwLpCBt90/45 kdsK92ixV5ZOxH8I5V9HphSW4y51kVPGAAS8khYE= Received: (qmail 85160 invoked by alias); 24 Jul 2018 10:04:56 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 85027 invoked by uid 89); 24 Jul 2018 10:04:55 -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 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:04:52 +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 F105F80D for ; Tue, 24 Jul 2018 03:04:50 -0700 (PDT) Received: from localhost (unknown [10.32.99.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 789403F237 for ; Tue, 24 Jul 2018 03:04:50 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [30/46] Use stmt_vec_infos rather than gimple stmts for worklists References: <87wotlrmen.fsf@arm.com> Date: Tue, 24 Jul 2018 11:04:48 +0100 In-Reply-To: <87wotlrmen.fsf@arm.com> (Richard Sandiford's message of "Tue, 24 Jul 2018 10:52:16 +0100") Message-ID: <87bmaxne4f.fsf@arm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 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 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