From patchwork Thu Nov 22 19:47:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 1001962 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-490753-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="o8KHwEEZ"; 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 43192K3T8sz9s1c for ; Fri, 23 Nov 2018 06:47:21 +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:from :to:cc:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=noG0jcP1PfsTzfsOrulqH61QRIiXkWAqyR/TOReIHDNOiY47Ru YogInE19FEuegBKfh+q2Wq7w28LGsPPTMK6/KzTEytkjJVDLP+s0GNVBp6jWyf24 b3JQn4PcSFinf1oEtcDRbzLVMYkmzSHhGIUI7305b/iX8jjAz5aHikmwU= 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:cc:subject:message-id:date:mime-version:content-type; s= default; bh=1Gg09WyYDZKuDIytW9yz1KIC5dc=; b=o8KHwEEZjFH4dmpsVQGF NovYY6iWm57ZcYLE/ngVjNRYhH0NZ/olZEZ710jLlKYwp0L1h+5CXrpZlTSLXBgW eB6hVgn0sADMyZrJgdiLu4pNTkHlVRl5tq5dxgB98fZlWRpqNAbZZc5jbjgRjGeb 2E0z6qtv2MlipH0I0qgMJ1g= Received: (qmail 57297 invoked by alias); 22 Nov 2018 19:47:14 -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 57277 invoked by uid 89); 22 Nov 2018 19:47:13 -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, KAM_SHORT, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=topic, Hx-languages-length:2089, rfa, unary X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 Nov 2018 19:47:12 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 328913154872; Thu, 22 Nov 2018 19:47:11 +0000 (UTC) Received: from topor.usersys.redhat.com (unused-10-15-17-214.yyz.redhat.com [10.15.17.214]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED4535C25A; Thu, 22 Nov 2018 19:47:10 +0000 (UTC) From: Vladimir Makarov To: gcc-patches Cc: Michael Meissner Subject: RFA: patch for test PR70669 test Message-ID: <68d7c42c-3ebe-532b-6403-63f8975d97d2@redhat.com> Date: Thu, 22 Nov 2018 14:47:10 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 X-IsSubscribed: yes Today I committed a patch https://gcc.gnu.org/ml/gcc-patches/2018-11/msg01945.html   But it makes gcc.target/powerpc/pr70669.c to fail.  Here is the patch to fix the failure.  The expected code assumes that variable r should get a general reg.  I suspect the expectation is wrong. There are three possible choices for r: a general reg, a vsx reg, and memory.   The cost of move of vsx to/from mem is 4, the cost of move of general reg of this mode to/from mem is 8, and the cost of move of general reg to/from vsx is 12.   So approximately if r is assigned memory we have cost 8 * 2 (asm) + 4 * 2 (plus) = 24 (when we use memory at *q), if r is assigned to vsx the cost is 12*2(asm) + 4(r=*q) = 28, and if r is assigned a general reg the cost is 12 * 2 (plus) + 8 (r = *q) = 32.   ira-costs should choose mem although it chose a general reg before my patch (it is a big topic why it chose a general reg. In brief, it is because some inherent drawbacks of the current cost calculation algorithm). The patch I recently submitted solves some drawbacks and memory is chosen for r.  To generate the expected code with r in a general reg, I just decrease the number of getting r value into vsx reg by changing r + r onto -r. Is the following patch ok for trunk? Index: testsuite/ChangeLog =================================================================== --- testsuite/ChangeLog (revision 266318) +++ testsuite/ChangeLog (working copy) @@ -1,3 +1,8 @@ +2018-11-22 Vladimir Makarov + + * gcc.target/powerpc/pr70669.c: Use unary minus instead of + addition. + 2018-11-20 Jan Hubicka PR ipa/87706 Index: testsuite/gcc.target/powerpc/pr70669.c =================================================================== --- testsuite/gcc.target/powerpc/pr70669.c (revision 266318) +++ testsuite/gcc.target/powerpc/pr70669.c (working copy) @@ -13,7 +13,7 @@ void foo (TYPE *p, TYPE *q) #ifndef NO_ASM __asm__ (" # %0" : "+r" (r)); #endif - *p = r + r; + *p = -r; } /* { dg-final { scan-assembler "mfvsrd" } } */