From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10763 invoked by alias); 26 Mar 2007 22:05:26 -0000 Received: (qmail 10731 invoked by alias); 26 Mar 2007 22:05:16 -0000 Date: Mon, 26 Mar 2007 22:05:00 -0000 Message-ID: <20070326220516.10730.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug rtl-optimization/31360] [4.2/4.3 Regression] rtl loop invariant is broken In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rakdver at atrey dot karlin dot mff dot cuni dot cz" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-03/txt/msg02522.txt.bz2 ------- Comment #13 from rakdver at atrey dot karlin dot mff dot cuni dot cz 2007-03-26 23:05 ------- Subject: Re: [4.2/4.3 Regression] rtl loop invariant is broken > Zdenek, what is the size heuristic for anyway? For powerpc, the current > heuristic tells the compiler not to move any simple moves: > > 1) An invariant with a gain of 0 will not be moved. > 2) gain = comp_cost - size_cost > 3) comp_cost of a simple move is 4 > 4) all powerpc instructions have a size_cost of 4 > > (At least, the insns that map to a single machine insns have a size_cost of 4.) size_cost and global_cost_for_size are somewhat missnamed. The purpose of global_cost_for_size is to estimate the effect of register pressure, and it currently works this way: 1) if the number of used registers is significantly smaller than the number of available registers, then the cost for each newly used register is target_small_cost (which probably turns out to be 4 on ppc) 2) if the number of used registers approaches the number of available registers, the cost for a newly used register increases more significantly (by target_pres_cost and later by target_spill_cost). The purpose of 1) should have been to prevent optimizations that do not gain anything and increase register pressure, but apparently this does not work quite well. Two possible solutions are decreasing target_small_cost (maybe setting it fixed to one), or even removing the penalty for increasing number of used registers in the case 1) completely. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31360