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: Help w/ CFG/loop optimization problem?


In message <41F35CB0-C5C3-11D6-93B1-003065C86F94@apple.com>, Dale Johannesen wr
ites:
 >
 >On Wednesday, September 11, 2002, at 12:57 PM, Jeff Law wrote:
 >
 >> In message <A21CD16A-C4F8-11D6-93B1-003065C86F94@apple.com>, Dale 
 >> Johannesen wr
 >> ites:
 >>> I've run into an optimization problem with
 >>>
 >>>     if (count > 10)
 >>>         for (i = 0; i < count; ++i)
 >>>             pcb += i;
 >>>     else...
 >> It'd really help to have a compilable example.
 >
 >Here you go.  On ppc/darwin, the second loop is recognized
 >as a doloop, the first is not.  Sorry to have oversimplified.
 >(I'm looking at this myself along the lines suggested by
 >Jan Hubicka, BTW.)
OK.  Thanks.

Another approach would be to delay creation of loop notes until just before
the loop optimizer runs.

For LOOP_BEGIN and LOOP_END notes, this would be pretty easy.  It probably
wouldn't be terribly difficult for VTOP notes either.  The tough one would
be the LOOP_CONT notes.  I'm not sure offhand if there's any standard
algorithms which would find the insertion point for LOOP_CONT notes for us.

In fact, you could take this a step further and remove them after the loop
optimizer was finished.  This would be a step forward in that we've isolated
parts of the lameness in our loop optimizer implementation from the rest of
the compiler.

jeff


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