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]

Re: [PATCH 3/3] Loop flattening on loop-SSA.


On Tue, Nov 16, 2010 at 12:07 AM, Sebastian Pop <sebpop@gmail.com> wrote:
> On Mon, Nov 15, 2010 at 17:01, Richard Guenther
> <richard.guenther@gmail.com> wrote:
>> Sure it would - cancel_loop_tree (loop->inner) makes loop->inner->next
>> loop->inner. ?This is why cancel_loop_tree works in the first place.
>
> I still cannot see how this code would cancel loop->next...
> I see no occurrences of ->next in these functions:
>
> /* Cancels the LOOP; it must be innermost one. ?*/
>
> static void
> cancel_loop (struct loop *loop)
> {
> ?basic_block *bbs;
> ?unsigned i;
> ?struct loop *outer = loop_outer (loop);
>
> ?gcc_assert (!loop->inner);
>
> ?/* Move blocks up one level (they should be removed as soon as possible). ?*/
> ?bbs = get_loop_body (loop);
> ?for (i = 0; i < loop->num_nodes; i++)
> ? ?bbs[i]->loop_father = outer;
>
> ?delete_loop (loop);
> }
>
> /* Cancels LOOP and all its subloops. ?*/
> void
> cancel_loop_tree (struct loop *loop)
> {
> ?while (loop->inner)
> ? ?cancel_loop_tree (loop->inner);
> ?cancel_loop (loop);
> }

delete_loop calls flow_loop_tree_node_remove which updates the loop
fathers loop sibling chain.

Richard.


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