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]

Re: flow_d_f_o_compute misnamed? (was: if-conversion a performance...)


Michael Matz writes:

 > If DFS first detects inner loops (after some thinking I see that too :))
 > then some comments in flow_loops_find() are wrong (some say, they are
 > searching for outer first), and flow_depth_first_order_compute() should be
 > corrected to do what the name promises ;) Or do I miss something obvious?

Even though I wrote this, I cannot remember the details and
unfortunately I do not have my work book with me at present.

It is quite possible that my depth first search algorithm is wrong as
I am naive when it comes to graph theory. I vaguely recall converting
my original recursive algorithm to an iterative algorithm so I could
easily have made a mistake.

 > I mean it works somehow right now, I'm not really sure if I can believe
 > that such a central function is incorrect and nobody noticed.

Although the DFS algorithm may be wrong, it may have no effect on the
loop finding algorithm.  For the latter, it is not essential that all
the outer loops in the CFG are found first but that with nested loops,
an inner loop is found after its containing outer loop.  Possibly
my `DFS' algorithm also has this property?

Michael.


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