From patchwork Fri Feb 2 23:30:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 868827 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-472569-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="qS4hRr3+"; 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 3zYCsh4CbXz9sRV for ; Sat, 3 Feb 2018 10:31:01 +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:date:mime-version:content-type :content-transfer-encoding:message-id; q=dns; s=default; b=xs1b2 u6zNJbElgJeoQOW7+LkEXP0HbVQZmiWgBN8xRxbXxLKkqVkzn6pTnKvE9EzQRzpM xBnEKRioxjuwb2s+KMAx+5xWF8sVh3fzujtYQhUw6t28xdl6IyKzoWdr9hrYBpZG xWRzecGgQoJOeijij26wQ5gJtPjCR1XVubras0= 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:date:mime-version:content-type :content-transfer-encoding:message-id; s=default; bh=Zy/k6ihh8Gj oqaThJFAgmBGZbYk=; b=qS4hRr3+ZD1e+qZOB3WHBvtRpZN2oYk+ECrUilEv5Fn Re63i4SOL4PvCqB4Q9YFPi/2WkS19GV7gub93pqwpXUbv2T4OTU5XOlrh6c383/N a630kwiNjdMAtPZwVqxf+Igki1lqJVJVqsQFB2EV+JmMzutf2VJFuilpxGO1VD+0 = Received: (qmail 105712 invoked by alias); 2 Feb 2018 23:30:54 -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 105701 invoked by uid 89); 2 Feb 2018 23:30:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=began, mailer X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Feb 2018 23:30:52 +0000 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w12NTSCl037091 for ; Fri, 2 Feb 2018 18:30:50 -0500 Received: from e18.ny.us.ibm.com (e18.ny.us.ibm.com [129.33.205.208]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fvvufj75q-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 02 Feb 2018 18:30:50 -0500 Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 2 Feb 2018 18:30:49 -0500 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e18.ny.us.ibm.com (146.89.104.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 2 Feb 2018 18:30:46 -0500 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w12NUk1B47906938; Fri, 2 Feb 2018 23:30:46 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9E891AC03F; Fri, 2 Feb 2018 18:32:05 -0500 (EST) Received: from bigmac.rchland.ibm.com (unknown [9.10.86.76]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id 79486AC041; Fri, 2 Feb 2018 18:32:05 -0500 (EST) To: GCC Patches Cc: Richard Biener From: Bill Schmidt Subject: [PATCH] Fix PR81038 Date: Fri, 2 Feb 2018 17:30:45 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18020223-0044-0000-0000-000003DADA5C X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008463; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000248; SDB=6.00984171; UDB=6.00499200; IPR=6.00763450; BA=6.00005809; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00019342; XFM=3.00000015; UTC=2018-02-02 23:30:48 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18020223-0045-0000-0000-0000080A4730 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-02-02_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802020283 X-IsSubscribed: yes Hi, The test g++.dg/vect/slp-pr56812.cc is somewhat fragile and is currently failing on several targets. PR81038 notes that this began with r248678, which stopped some inferior peeling solutions from preventing vectorization that could be done without peeling. I observed that for powerpc64le, r248677 vectorizes the code during SLP, but r248678 vectorizes it during the loop vectorization pass. Which pass does the vectorization is quite dependent on cost model, which for us is a quite close decision. In any case, the important thing is that the code is vectorized, not which pass does it. This patch prevents the test from flipping in and out of failure status depending on which pass does the vectorization, by testing the final "optimized" dump for the expected vectorized output instead of relying on a specific vectorization pass dump. By the way, the test case somehow had gotten DOS/Windows newlines into it, so I removed those. The ^M characters disappeared when I pasted into this mailer, unfortunately. Anyway, that's the reason for the full replacement of the file. The only real changes are the dg-final directives and the documentation of the expected output. Verified on powerpc64le-unknown-linux-gnu. Is this okay for trunk? Thanks, Bill 2018-02-02 Bill Schmidt * g++.dg/vect/slp-pr56812.cc: Convert from DOS newline characters to utf-8-unix. Change to scan "optimized" dump for indications that the code was vectorized. Index: gcc/testsuite/g++.dg/vect/slp-pr56812.cc =================================================================== --- gcc/testsuite/g++.dg/vect/slp-pr56812.cc (revision 257352) +++ gcc/testsuite/g++.dg/vect/slp-pr56812.cc (working copy) @@ -1,22 +1,31 @@ -/* { dg-do compile } */ -/* { dg-require-effective-target vect_float } */ -/* { dg-require-effective-target vect_hw_misalign } */ -/* { dg-additional-options "-O3 -funroll-loops -fvect-cost-model=dynamic" } */ - -class mydata { -public: - mydata() {Set(-1.0);} - void Set (float); - static int upper() {return 8;} - float data[8]; -}; - -void mydata::Set (float x) -{ - for (int i=0; i [11.11%]: + vect_cst__10 = {x_5(D), x_5(D), x_5(D), x_5(D)}; + MEM[(float *)this_4(D)] = vect_cst__10; + MEM[(float *)this_4(D) + 16B] = vect_cst__10; + return; + + Could be vectorized either by the "vect" or the "slp" pass. */