From patchwork Wed Nov 18 11:34:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 545962 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 003DC14144B for ; Wed, 18 Nov 2015 22:34:55 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=p1AfcJl+; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=w2u9gF3Y/JS5euerNjnZ0YEP5zm3FUiSzF4HGxmag2HNqqgfhK7Ge QxfRLjUOhsgMoOqQc7NJvvJI6/z1bzC9kmh21LQo+gSfOw1qs7cvgSPYSjfIswp8 FIMmadyIXV057sYTsNa7jRcZ9lP5BIxaeeVmOMCNOdjLSLMFz46tIc= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=tVwHb7AgPmeVVG86PXNjJqEPlek=; b=p1AfcJl+QDwgwRj6xjrQ iZi7i3W6y8VcMkwd780ImefQFC7pbrQr3yFfhTMWt4Ysn6Sv4eAMLZSZTxEJp+Pt j83IoEl+ptK7Yq6ynUVgLo61IUzOhNxVOFIDZkfKWzKhQ2smrphqGFP0rlSs2vYE wHw/yvd0eSlu3kqhi5bQGNw= Received: (qmail 123264 invoked by alias); 18 Nov 2015 11:34:48 -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 123252 invoked by uid 89); 18 Nov 2015 11:34:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ig0-f178.google.com Received: from mail-ig0-f178.google.com (HELO mail-ig0-f178.google.com) (209.85.213.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 18 Nov 2015 11:34:46 +0000 Received: by igbxm8 with SMTP id xm8so36052597igb.1 for ; Wed, 18 Nov 2015 03:34:44 -0800 (PST) X-Received: by 10.50.117.5 with SMTP id ka5mr2531691igb.58.1447846484511; Wed, 18 Nov 2015 03:34:44 -0800 (PST) Received: from msticlxl57.ims.intel.com ([134.134.139.76]) by smtp.gmail.com with ESMTPSA id n3sm9857975iga.0.2015.11.18.03.34.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Nov 2015 03:34:44 -0800 (PST) Date: Wed, 18 Nov 2015 14:34:18 +0300 From: Ilya Enkovich To: gcc-patches@gcc.gnu.org Subject: [PATCH, PR tree-optimization/68327] Compute vectype for live phi nodes when copmputing VF Message-ID: <20151118110701.GB42296@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes Hi, When we compute vectypes we skip non-relevant phi nodes. But we process non-relevant alive statements and thus may need vectype of non-relevant live phi node to compute mask vectype. This patch enables vectype computation for live phi nodes. Botostrapped and regtested on x86_64-unknown-linux-gnu. OK for trunk? Thanks, Ilya --- gcc/ 2015-11-18 Ilya Enkovich PR tree-optimization/68327 * tree-vect-loop.c (vect_determine_vectorization_factor): Don't skip non-relevant live phi nodes. gcc/testsuite/ 2015-11-18 Ilya Enkovich PR tree-optimization/68327 * gcc.dg/pr68327.c: New test. diff --git a/gcc/testsuite/gcc.dg/pr68327.c b/gcc/testsuite/gcc.dg/pr68327.c new file mode 100644 index 0000000..c3e6a94 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr68327.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O3" } */ + +int a, d; +char b, c; + +void +fn1 () +{ + int i = 0; + for (; i < 1; i++) + d = 1; + for (; b; b++) + a = 1 && (d & b); +} diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 80937ec..7dba027 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -216,7 +216,8 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo) gcc_assert (stmt_info); - if (STMT_VINFO_RELEVANT_P (stmt_info)) + if (STMT_VINFO_RELEVANT_P (stmt_info) + || STMT_VINFO_LIVE_P (stmt_info)) { gcc_assert (!STMT_VINFO_VECTYPE (stmt_info)); scalar_type = TREE_TYPE (PHI_RESULT (phi));