From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25420 invoked by alias); 9 Oct 2015 02:45:01 -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 25399 invoked by uid 89); 9 Oct 2015 02:45:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vk0-f46.google.com Received: from mail-vk0-f46.google.com (HELO mail-vk0-f46.google.com) (209.85.213.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 09 Oct 2015 02:44:58 +0000 Received: by vkat63 with SMTP id t63so43570204vka.1 for ; Thu, 08 Oct 2015 19:44:56 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.31.153.129 with SMTP id b123mr1258984vke.117.1444358696605; Thu, 08 Oct 2015 19:44:56 -0700 (PDT) Received: by 10.103.65.1 with HTTP; Thu, 8 Oct 2015 19:44:56 -0700 (PDT) In-Reply-To: <37378DC5BCD0EE48BA4B082E0B55DFAA4299E4C1@XAP-PVEXMBX02.xlnx.xilinx.com> References: <37378DC5BCD0EE48BA4B082E0B55DFAA4299E44D@XAP-PVEXMBX02.xlnx.xilinx.com> <37378DC5BCD0EE48BA4B082E0B55DFAA4299E4C1@XAP-PVEXMBX02.xlnx.xilinx.com> Date: Fri, 09 Oct 2015 02:45:00 -0000 Message-ID: Subject: Re: [RFC, Patch]: Optimized changes in the register used inside loop for LICM and IVOPTS. From: "Bin.Cheng" To: Ajit Kumar Agarwal Cc: GCC Patches , Vinod Kathail , Shail Aditya Gupta , Vidhumouli Hunsigida , Nagaraju Mekala Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00913.txt.bz2 On Thu, Oct 8, 2015 at 1:53 PM, Ajit Kumar Agarwal wrote: > > > -----Original Message----- > From: Bin.Cheng [mailto:amker.cheng@gmail.com] > Sent: Thursday, October 08, 2015 10:29 AM > To: Ajit Kumar Agarwal > Cc: GCC Patches; Vinod Kathail; Shail Aditya Gupta; Vidhumouli Hunsigida;= Nagaraju Mekala > Subject: Re: [RFC, Patch]: Optimized changes in the register used inside = loop for LICM and IVOPTS. > > On Thu, Oct 8, 2015 at 12:32 PM, Ajit Kumar Agarwal wrote: >> Following Proposed: >> >> Changes are done in the Loop Invariant(LICM) at RTL level and also the I= nduction variable optimization based on SSA representation. >> The current logic used in LICM for register used inside the loops is >> changed. The Live Out of the loop latch node and the Live in of the >> destination of the exit nodes is used to set the Loops Liveness at the e= xit of the Loop. The register used is the number of live variables at the e= xit of the Loop calculated above. >> >> For Induction variable optimization on tree SSA representation, the >> register used logic is based on the number of phi nodes at the loop >> header to represent the liveness at the loop. Current Logic used only th= e number of phi nodes at the loop header. I have made changes to represent= the phi operands also live at the loop. Thus number of phi operands also g= ets incremented in the number of registers used. > Hi, >>>For the GIMPLE IVO part, I don't think the change is reasonable enough. = IMHO, IVO fails to restrict iv number in some complex cases, your change t= ries to >>rectify that by increasing register pressure irrespective to out-= of-ssa and coalescing. I think the original code models reg-pressure bette= r, what needs to be >>changed is how we compute cost from register pressure= and use that to restrict iv number. > > Considering the liveness with respect to all the phi arguments will not i= ncrease the register pressure. It improves the heuristics for restricting > The IV that increases the register pressure. The cost model uses regs_use= d and modelling the I think register pressure is increased along with regs_needed, doesn't matter if it will be canceled in estimate_reg_pressure_cost for both ends of cost comparison. Liveness with respect to the phi arguments measures > Better register pressure. I agree IV number should be controlled for some cases, but not by increasing `n' using phi argument number unconditionally. Considering summary reduction as an example, most likely the ssa names will be coalesced and held in single register. Furthermore, there is no reason to count phi node/arg number for floating point phi nodes. > > Number of phi nodes in the loop header is not only the criteria for regs_= used, but the number of liveness with respect to loop should be > Criteria to measure appropriate register pressure. IMHO, it's hard to accurately track liveness info on SSA(PHI), because of coalescing etc. So could you give some examples/proof for this? Thanks, bin > > Thanks & Regards > Ajit