This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Help w/ CFG/loop optimization problem?
- From: Jeff Law <law at porcupine dot slc dot redhat dot com>
- To: Dale Johannesen <dalej at apple dot com>
- Cc: gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Wed, 11 Sep 2002 15:37:48 -0600
- Subject: Re: Help w/ CFG/loop optimization problem?
- Reply-to: law at redhat dot com
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