From patchwork Tue Sep 26 11:39:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Krebbel X-Patchwork-Id: 818587 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-462960-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="tOxAbjRs"; 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 3y1fCj4qtRz9t49 for ; Tue, 26 Sep 2017 21:40:49 +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:date:in-reply-to:references:message-id; q=dns; s= default; b=Briov8MMGyF6CKgNBxYAVWn+OCoki/bhu8FUaBlcqikmoIeR0pxZ5 ZfjiZCXfUb29BMSPKCe1Q4TLp+GFjf+J4sChv1Wopmc5jOSZCaMCZoKNT9xwyKgI P3BTzVCd8gDfWfLFDrjQnmrhy284GJwemQkev0gc/zRdDNVPF2tznQ= 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:date:in-reply-to:references:message-id; s=default; bh=dXmQzSmr1WZ4Akreiq7KjgKHdh4=; b=tOxAbjRsmsc/ePOUO/kVLvVhWY/9 owoTK84KwuXr3N8K+Nx+BAv0oRj1Tvc6lCAKiGa4vZwfBsZzDn1lNxCWdY/OlBXT LGgwHZ4zvDskC9HySaMcYz69xLubTzZvfSYgRCoQbkPNf79+d5wWOsChI6BoavfR h3K0TlpGw73Q3GE= Received: (qmail 34614 invoked by alias); 26 Sep 2017 11:40:08 -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 34507 invoked by uid 89); 26 Sep 2017 11:40:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 26 Sep 2017 11:40:06 +0000 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v8QBdUkB128585 for ; Tue, 26 Sep 2017 07:40:01 -0400 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0b-001b2d01.pphosted.com with ESMTP id 2d7ktvsx8x-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 26 Sep 2017 07:40:01 -0400 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 26 Sep 2017 12:39:59 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 26 Sep 2017 12:39:56 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v8QBdusk26083328 for ; Tue, 26 Sep 2017 11:39:56 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5BB3C4C044 for ; Tue, 26 Sep 2017 12:36:12 +0100 (BST) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 41F6E4C040 for ; Tue, 26 Sep 2017 12:36:12 +0100 (BST) Received: from maggie.boeblingen.de.ibm.com (unknown [9.152.212.134]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS for ; Tue, 26 Sep 2017 12:36:12 +0100 (BST) From: Andreas Krebbel To: gcc-patches@gcc.gnu.org Subject: [PATCH 4/5] New target check: vect_nopeel Date: Tue, 26 Sep 2017 13:39:49 +0200 In-Reply-To: <20170926113950.5472-1-krebbel@linux.vnet.ibm.com> References: <20170926113950.5472-1-krebbel@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17092611-0008-0000-0000-0000049A2ABC X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17092611-0009-0000-0000-00001E2B74DA Message-Id: <20170926113950.5472-5-krebbel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-09-26_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709260171 X-IsSubscribed: yes Without peeling loops for vector alignment the vectorization costs are lower and in some cases make the loop vectorizer cover optimizations which otherwise would be handelt in slp instead. This adds a new target check for that purpose. gcc/testsuite/ChangeLog: 2017-09-26 Andreas Krebbel * g++.dg/vect/slp-pr56812.cc: Check vect_nopeel. * lib/target-supports.exp (check_effective_target_vect_nopeel): New proc. --- gcc/testsuite/g++.dg/vect/slp-pr56812.cc | 4 +++- gcc/testsuite/lib/target-supports.exp | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/g++.dg/vect/slp-pr56812.cc b/gcc/testsuite/g++.dg/vect/slp-pr56812.cc index 80bdcdd..955b2ef 100644 --- a/gcc/testsuite/g++.dg/vect/slp-pr56812.cc +++ b/gcc/testsuite/g++.dg/vect/slp-pr56812.cc @@ -17,4 +17,6 @@ void mydata::Set (float x) data[i] = x; } -/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp1" } } */ +/* For targets without vector loop peeling the loop becomes cheap + enough to be vectorized. */ +/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp1" { target { ! vect_nopeel } } } } */ diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 7fdfbbb..686465a 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -3199,6 +3199,28 @@ proc check_effective_target_vect_floatuint_cvt { } { return $et_vect_floatuint_cvt_saved($et_index) } +# Return 1 if peeling for alignment is never profitable on the target +# + +proc check_effective_target_vect_nopeel { } { + global et_vect_nopeel_saved + global et_index + + if [info exists et_vect_nopeel_saved($et_index)] { + verbose "check_effective_target_vect_nopeel: using cached result" 2 + } else { + set et_vect_nopeel_saved($et_index) 0 + if { ([istarget s390*-*-*] + && [check_effective_target_s390_vx]) } { + set et_vect_nopeel_saved($et_index) 1 + } + } + + verbose "check_effective_target_vect_nopeel:\ + returning $et_vect_nopeel_saved($et_index)" 2 + return $et_vect_nopeel_saved($et_index) +} + # Return 1 if the target supports #pragma omp declare simd, 0 otherwise. # # This won't change for different subtargets so cache the result.