From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29987 invoked by alias); 8 Jul 2011 14:15:25 -0000 Received: (qmail 29977 invoked by uid 22791); 8 Jul 2011 14:15:24 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from lo.gmane.org (HELO lo.gmane.org) (80.91.229.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 08 Jul 2011 14:15:12 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QfBph-0004V1-7F for gcc-patches@gcc.gnu.org; Fri, 08 Jul 2011 16:15:05 +0200 Received: from 93-34-199-31.ip51.fastwebnet.it ([93.34.199.31]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Jul 2011 16:15:05 +0200 Received: from bonzini by 93-34-199-31.ip51.fastwebnet.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Jul 2011 16:15:05 +0200 To: gcc-patches@gcc.gnu.org From: Paolo Bonzini Subject: Re: [df-scan.c] Optimise DF_REFs ordering in collection_rec, use HARD_REG_SETs instead of bitmaps Date: Fri, 08 Jul 2011 14:25:00 -0000 Message-ID: <4E1710DA.2000909@gnu.org> References: <20110708063704.GU2687@tyan-ft48-01.lab.bos.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Jakub Jelinek , gcc-patches@gcc.gnu.org, Steven Bosscher User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Mnenhy/0.8.3 Thunderbird/3.1.10 In-Reply-To: X-IsSubscribed: yes 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 X-SW-Source: 2011-07/txt/msg00646.txt.bz2 Message-ID: <20110708142500.Mw1ciq_r9SK4gw7nPtJGYEX885mxcZQjmStUVNBkla8@z> On 07/08/2011 11:05 AM, Dimitrios Apostolou wrote: > On Fri, 8 Jul 2011, Jakub Jelinek wrote: >> On Fri, Jul 08, 2011 at 06:20:04AM +0300, Dimitrios Apostolou wrote: >>> The attached patch does two things for df_get_call_refs(): >>> * First it uses HARD_REG_SETs for defs_generated and >>> regs_invalidated_by_call, instead of bitmaps. Replacing in total >>> more than 400K calls (for my testcase) to bitmap_bit_p() with the >>> much faster TEST_HARD_REG_BIT, reduces the total instruction count >>> from about 13M to 1.5M. >> >> Have you verified that collection_rec->def_vec never contains pseudo >> register references? Otherwise you couldn't use >> HARD_REG_SET... gcc_checking_assert might be useful. >> > > Hi Jakub, Steve pointed me to the following from GCC Internals Manual: > > call_insn insns have the same extra fields as insn insns, accessed in > the same way and in addition contain a field CALL_INSN_FUNCTION_USAGE, > which contains a list (chain of expr_list expressions) containing use > and clobber expressions that denote hard registers and MEMs used or > clobbered by the called function. > > So doesn't that mean that for CALL insns it should contain only HARD_REG > DEFs? I will ofcourse use an assert to be sure. That part is only for CALL_INSN_FUNCTION_USAGE, which is what df_get_call_refs handles. However, if you rewrite the handling of defs_generated as required by your second patch, you'll then be sure that you will only have hard registers. BTW, what testcase are you using? I suggest that you try building stage1 with CFLAGS=--save-temps, and get some of the largest preprocessed .i files from there (combine and fold-const for example). You can then time them very easily from the old and new build directories, with "./cc1 /path/to/file.i -O2". Paolo