From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 80111 invoked by alias); 4 Jul 2016 17:40:58 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 80049 invoked by uid 89); 4 Jul 2016 17:40:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=uncertain, Hx-languages-length:1820 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 04 Jul 2016 17:40:48 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2802A7F342; Mon, 4 Jul 2016 17:40:47 +0000 (UTC) Received: from localhost.localdomain (vpn1-6-233.ams2.redhat.com [10.36.6.233]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u64Heicg002047; Mon, 4 Jul 2016 13:40:45 -0400 Subject: Re: [lra] Cleanup the use of offmemok and don't count spilling cost for it To: Jiong Wang References: <0d4316cc-8ee3-b5cc-9c26-50365ff82201@redhat.com> <20160627162614.GA30612@linux.vnet.ibm.com> <4f0aadf8-f12e-4ef3-c4d5-c97e31a89b87@foss.arm.com> <57737646.30704@linux.vnet.ibm.com> <8c973240-26b0-d58b-555e-512d4503522e@foss.arm.com> <75631e5b-0e81-cc18-4bf8-295f8878dd9c@foss.arm.com> Cc: gcc-patches@gcc.gnu.org, Andreas Krebbel , vogt@linux.vnet.ibm.com, Jeff Law , Vladimir N Makarov , Robin Dapp From: Bernd Schmidt Message-ID: <33509d96-93fa-5c7c-ee6b-7c24111893ec@redhat.com> Date: Mon, 04 Jul 2016 17:40:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <75631e5b-0e81-cc18-4bf8-295f8878dd9c@foss.arm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-07/txt/msg00148.txt.bz2 On 07/04/2016 04:05 PM, Jiong Wang wrote: > And the corresponding s390 patten is "mov" for V_128. > > (define_insn "mov" > [(set (match_operand:V_128 0 "" "=v,v,R, v, v, v, v, v,v,d") > (match_operand:V_128 1 "" "v,R,v,j00,jm1,jyy,jxx,jKK,d,v"))] > > As the offset "-16" does not qualify s390_short_displacement, we need a > reload. > > Ideally we want alternative 2, for which gcc simply reload the mem > address into a address register. > > r157:DI=r116:DI+r69:DI-0x10 > [r157:DI]=r134:V16QI#0 > > While after r237277, gcc is treating the reload of insn 41 as a spill > and thus increased the costs for it, then alternative 8 beat alternative > 2, thus the following reload sequences are generated. > > r157:V4SI=r134:V16QI#0 > [r116:DI+r69:DI-0x10]=r157:V4SI > > GCC move the vector register into general register, then a second > instruction to store the general register into memory so it can match > alternative 8, which is "v", "d". > > However the second instructions still constains the illegal mem address, > thus a further reload triggered, and gcc triggers above max number > reload issue. > > The functional chang of this patch is to make gcc don't treat an memory > address reload as spill which is regression caused by r237277. > > Does this explanation make sense? Yes, it explains well what's going on. I think the part of your patch that avoids counting a reload of an address as a spill looks ok. I'm uncertain whether the code still has issues after that, it seems a little iffy not to count the cost of reloading the memory address at all. We might have to add code at some point to detect if we're reloading a move instruction and would be generating an identical one when picking a given alternative. Bernd