From patchwork Thu Oct 31 18:04:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Andre Vieira (lists)" X-Patchwork-Id: 1187624 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-512187-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="rMu5+ckE"; 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 473tWt334Hz9sPd for ; Fri, 1 Nov 2019 05:04:56 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=R57A8ZXy2LIRTcApQVspte7JSUJb9yS3r2oMJGQDN+8xx9CxMJ FHR0v5h0fPd7toKXAAIBrBZnRMCpuGS+LAtx3YqK+WWA4Gn5FSiKO+FM8G4qSvxn j8blWlZ7U/R1c5qPuU5CZClbXMdQuFHdlmGaclTvuhPPgZetDBI8VsXMk= 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:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=aNnxulc/xObpxKEVetoCiWpqgvM=; b=rMu5+ckETqkBfkumcpQs XTEF+xdgyzRulfLKB7zwS//YYGweYSrcs4DvMIYY/uRL0+OGc9jj57iKnIplpaOu oaYZcy47DUXSrAyeJiEgfr3K0AxI912sW9sE+qKr19N0VpNK3Gb/5ICVgYFpF27y fMpf421LBZj4Itu71D4NDOA= Received: (qmail 99445 invoked by alias); 31 Oct 2019 18:04:49 -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 99436 invoked by uid 89); 31 Oct 2019 18:04:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LOTSOFHASH, SPF_PASS autolearn=ham version=3.3.1 spammy=UD:tree-vect-loop.c, UD:tree-vectorizer.c, loop_vec_info, sk:try_vec X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 Oct 2019 18:04:47 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D8EC81FB; Thu, 31 Oct 2019 11:04:45 -0700 (PDT) Received: from [10.2.206.37] (e107157-lin.cambridge.arm.com [10.2.206.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 686B53F6C4; Thu, 31 Oct 2019 11:04:45 -0700 (PDT) To: gcc-patches Cc: Richard Biener , richard.sandiford@arm.com From: "Andre Vieira (lists)" Subject: [PATCH][vect] Clean up orig_loop_vinfo from vect_analyze_loop Message-ID: <451cd999-1fa1-f502-455b-de2348db181c@arm.com> Date: Thu, 31 Oct 2019 18:04:44 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi, After my patch I believe the only way orig_loop_vinfo is not null when calling vect_analyze_loop is when it is called for an epilogue and in that case we no longer use that variable, since LOOP_VINFO_ORIG_LOOP_INFO is already set for the epilogue's loop_vec_info. This patch removes that parameter. Bootstrapped on x86_64 and aarch64. Is this OK for trunk? Cheers, Andre gcc/ChangeLog: 2019-10-31 Andre Vieira * tree-vect-loop.c (vect_analyze_loop): Remove orig_loop_vinfo parameter. * tree-vectorizer.h (vect_analyze_loop): Update declaration. * tree-vectorizer.c (try_vectorize_loop_1): Update calls to vect_analyze_loop. diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 9b7d2485b7cae81578c6a7d33304dc48134cc850..f3deada90cb30c3d5a69a8ca243b0b7687d356cc 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -2352,8 +2352,7 @@ again: loop_vec_info struct. If ORIG_LOOP_VINFO is not NULL epilogue must be vectorized. */ opt_loop_vec_info -vect_analyze_loop (class loop *loop, loop_vec_info orig_loop_vinfo, - vec_info_shared *shared) +vect_analyze_loop (class loop *loop, vec_info_shared *shared) { auto_vector_sizes vector_sizes; @@ -2405,9 +2404,7 @@ vect_analyze_loop (class loop *loop, loop_vec_info orig_loop_vinfo, bool fatal = false; - if (orig_loop_vinfo) - LOOP_VINFO_ORIG_LOOP_INFO (loop_vinfo) = orig_loop_vinfo; - else if (vect_epilogues && first_loop_vinfo) + if (vect_epilogues && first_loop_vinfo) LOOP_VINFO_ORIG_LOOP_INFO (loop_vinfo) = first_loop_vinfo; opt_result res = vect_analyze_loop_2 (loop_vinfo, fatal, &n_stmts); diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 71b5f380e2c91a7a551f6e26920bb17809abedf0..ce8d5c6a07c63d757ebbff445a457a3ec6464bfa 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -1716,9 +1716,7 @@ extern bool check_reduction_path (dump_user_location_t, loop_p, gphi *, tree, enum tree_code); extern bool needs_fold_left_reduction_p (tree, tree_code); /* Drive for loop analysis stage. */ -extern opt_loop_vec_info vect_analyze_loop (class loop *, - loop_vec_info, - vec_info_shared *); +extern opt_loop_vec_info vect_analyze_loop (class loop *, vec_info_shared *); extern tree vect_build_loop_niters (loop_vec_info, bool * = NULL); extern void vect_gen_vector_loop_niters (loop_vec_info, tree, tree *, tree *, bool); diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c index 8e02647c7bad6ce4a92a225a4d37f82439f771ae..0f00383e3b33098189b2f656a8bd02d0148dd888 100644 --- a/gcc/tree-vectorizer.c +++ b/gcc/tree-vectorizer.c @@ -865,8 +865,7 @@ set_uid_loop_bbs (loop_vec_info loop_vinfo, gimple *loop_vectorized_call) static unsigned try_vectorize_loop_1 (hash_table *&simduid_to_vf_htab, - unsigned *num_vectorized_loops, - loop_p loop, loop_vec_info orig_loop_vinfo, + unsigned *num_vectorized_loops, loop_p loop, gimple *loop_vectorized_call, gimple *loop_dist_alias_call) { @@ -890,7 +889,7 @@ try_vectorize_loop_1 (hash_table *&simduid_to_vf_htab, else { /* Try to analyze the loop, retaining an opt_problem if dump_enabled_p. */ - loop_vinfo = vect_analyze_loop (loop, orig_loop_vinfo, &shared); + loop_vinfo = vect_analyze_loop (loop, &shared); loop->aux = loop_vinfo; } @@ -1025,7 +1024,7 @@ try_vectorize_loop_1 (hash_table *&simduid_to_vf_htab, */ unsigned dont_count = *num_vectorized_loops; ret |= try_vectorize_loop_1 (simduid_to_vf_htab, &dont_count, - new_loop, loop_vinfo, NULL, NULL); + new_loop, NULL, NULL); } return ret; @@ -1042,8 +1041,7 @@ try_vectorize_loop (hash_table *&simduid_to_vf_htab, || loop->force_vectorize)) return 0; - return try_vectorize_loop_1 (simduid_to_vf_htab, num_vectorized_loops, - loop, NULL, + return try_vectorize_loop_1 (simduid_to_vf_htab, num_vectorized_loops, loop, vect_loop_vectorized_call (loop), vect_loop_dist_alias_call (loop)); }