This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: More PRE problems


In message <20031117153713.GA11815@nevyn.them.org>, Daniel Jacobowitz writes:
 >> In which case it would sound to me like the PHI insertion sites were
 >> goof'd up since PRE should be eliminating loop invariants.
 >
 >My SSA-fu is pretty weak, but I think it's easy to get such a PHI for
 >non-invariants...
 >
 >	i = 3;
 >	j = 0;
 >
 >.L4:	j++;
 >	if (i+j < 100) goto .L4
 >
 >	i++;
 >	if (i+j < 1000) goto .L4
 >
 >At L4 we'd have a PHI with three incoming edges, something like:
 >	i_1 = 3;
 >
 >.L4:	i_2 = PHI<i_1, i_2, i_3>
 >
 >	i_3 = i_2 + 1;
Well, this is the kind of situation I was talking about.

What ought to happen is something like this:



	i_1 = 3;
	j_1= 0;
        goto .L4
.L5:
        i_3 = PHI (i_2, i_1)
       
.L4:	j_3 = PHI (j_1, j_2)
        i_4 = PHI (i_1, i_3)
        j_2 = j_3 + 1;
	if (i_4+j_3 < 100) goto .L4

        i_2 = i_4 + 1;
	if (i_2+j_2 < 1000) goto .L5


Or something along those lines.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]