This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question about always executed info computed in tree-ssa-loop-im.c
- From: "Bin.Cheng" <amker dot cheng at gmail dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Wed, 8 Jul 2015 18:01:17 +0800
- Subject: Re: Question about always executed info computed in tree-ssa-loop-im.c
- Authentication-results: sourceware.org; auth=none
- References: <CAHFci2_YZJkUbtE4J9VWJYQ7xw8bWjGjDTAm2F23yQqVDhNP1g at mail dot gmail dot com> <CAFiYyc048On_wf=c5+m=qNtDgkMtuZ=18p6ydA3Dq4guQAWx-A at mail dot gmail dot com> <CAHFci2_QgJUmgfzV9PV6ioNm5aBWsRqpZppPXsp4X5DdD40WfQ at mail dot gmail dot com>
On Wed, Jul 8, 2015 at 5:58 PM, Bin.Cheng <amker.cheng@gmail.com> wrote:
> On Wed, Jul 8, 2015 at 5:51 PM, Richard Biener
> <richard.guenther@gmail.com> wrote:
>> On Wed, Jul 8, 2015 at 8:52 AM, Bin.Cheng <amker.cheng@gmail.com> wrote:
>>> Hi,
>>> Function fill_always_executed_in_1 computes basic blocks' always
>>> executed information, and it has below code and comment:
>>>
>>> /* In a loop that is always entered we may proceed anyway.
>>> But record that we entered it and stop once we leave it. */
>>> inn_loop = bb->loop_father;
>>>
>>> Then in following iterations, it breaks the loop if basic block not
>>> belonging to the inner loop is encountered. This means basic blocks
>>> after inner loop won't have always executed information computed, even
>>> they dominates the original loop's latch.
>>>
>>> Am I missing something? Why is that?
>>
>> To improve here it would need to verify that all exits of the inner loop
>> exit to the same BB of the outer loop and that no exit skips any blocks
>> in the outer loop. Like for
> But we are working on dominating tree anyway. Won't dominating latch be enough?
>
> Thanks,
> bin
>>
>> for (;;)
>> {
>> for (;;) { if (x) goto skip; if (y) break }
>> foo();
>> skip:
>> }
>>
>> so it is just a simple and conservative algorithm it seems. It's also
>> quadratic in the number of BBs of the outermost loop.
What we need to do is check if inner loop's exit goes to basic block
not belonging to outer loop?
Thanks,
bin