------- Additional Comments From rakdver at atrey dot karlin dot mff dot cuni dot cz 2005-01-21 08:18 ------- Subject: Re: [4.0 Regression] gcc-4.0.0 bloats code by 31%
> ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-21 > 07:57 ------- > I think one of the problems is that ivopts causes out of ssa not to Coalesce > two SSA_NAME: > Before out of ssa: > D.1127_16 = *ivtmp.8_9; > D.1128_21 = *ivtmp.12_30; > D.1129_22 = D.1127_16 - D.1128_21; > *ivtmp.12_30 = D.1129_22; > ivtmp.3_17 = ivtmp.3_18 + 1; > > # ivtmp.12_30 = PHI <ivtmp.12_35(0), ivtmp.12_31(1)>; > # ivtmp.8_9 = PHI <ivtmp.8_29(0), ivtmp.8_7(1)>; > # ivtmp.3_18 = PHI <0(0), ivtmp.3_17(1)>; > <L1>:; > ivtmp.8_7 = ivtmp.8_9 + 4B; > ivtmp.12_31 = ivtmp.12_30 + 4B; > D.1171_37 = ivtmp.3_18 + D.1163_6; > i_38 = (int) D.1171_37; > if (i_38 <= maxLen_4) goto <L0>; else goto <L2>; > > > After: > <L0>:; > *ivtmp.12 = *ivtmp.17 - *ivtmp.12; > ivtmp.3 = ivtmp.3 + 1; > ivtmp.17 = ivtmp.8; > ivtmp.12 = ivtmp.16; > > <L1>:; > ivtmp.8 = ivtmp.17 + 4B; > ivtmp.16 = ivtmp.12 + 4B; > if ((int) (ivtmp.3 + D.1163) <= maxLen) goto <L0>; else goto <L2>; > > Note how there are two moves in the BB for L0. > Coalesce list: (6)ivtmp.12_30 & (7)ivtmp.12_31 [map: 6, 7] : Fail due to > conflict > Coalesce list: (1)ivtmp.8_7 & (2)ivtmp.8_9 [map: 1, 2] : Fail due to conflict I am fairly sure that ivopts themselves create both ivtmp.12 and ivtmp.8 such that life ranges of their ssa names do not overlap. However some of the later passes (most probably dom) propagates ivtmp.8_9 to expressions after definition of ivtmp.8_7. It might help to add pass that would transform this code to the following, thus enabling the coalescing of ivs. I will give it a try. D.1127_16 = *ivtmp.8.9; D.1128_21 = *ivtmp.12.30; D.1129_22 = D.1127_16 - D.1128_21; *ivtmp.12.30 = D.1129_22; ivtmp.3_17 = ivtmp.3_18 + 1; # ivtmp.12_30 = PHI <ivtmp.12_35(0), ivtmp.12_31(1)>; # ivtmp.8_9 = PHI <ivtmp.8_29(0), ivtmp.8_7(1)>; # ivtmp.3_18 = PHI <0(0), ivtmp.3_17(1)>; <L1>:; ivtmp.8.9 = ivtmp.8_9; ivtmp.8_7 = ivtmp.8_9 + 4B; ivtmp.12.30 = ivtmp.12_30; ivtmp.12_31 = ivtmp.12_30 + 4B; D.1171_37 = ivtmp.3_18 + D.1163_6; i_38 = (int) D.1171_37; if (i_38 <= maxLen_4) goto <L0>; else goto <L2>; -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18219