This is the mail archive of the gcc-patches@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]

[tree-ssa] doloop problems


On the SSA branch for loops for some reason do not produce doloops optimizations.
This patch makes the for loops to cause it to happen.


Now gimplify for a for loop is from:
for (INIT;COND;INCREMENT)
	BODY
to:
INIT
if (COND)
	{
		while (1)
		{
			BODY
			INCREMENT
			if (!COND)
				goto OUTOFLOOP;
		}
OUTOFLOOP:
	}



Yes this makes increases the initial number of rtl (and trees) generated by 3 (4 from the mainline)
but by the time it gets written out as asm, there will be less rtl than what is generated
currently on the branch.


Testcase:
void temp(int limit, float *x)
{
        int i;
        for(i=0;i<limit;i++)
                x[i] = 0;
}


ChangeLog: 2003-06-16 Andrew Pinski <pinskia@physics.uc.edu>

	* c-simplify.c (gimplify_for_stmt): Add if before loop and
	move the condition to the end of the loop.


Patch:

Attachment: temp1.diff
Description: Binary data



Thanks,
Andrew Pinski

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