Groups | Search | Server Info | Login | Register


Groups > comp.compilers > #128

Question about the structure of a program dependence graph

From Douglas do Couto Teixeira <douglasdocouto@gmail.com>
Newsgroups comp.compilers
Subject Question about the structure of a program dependence graph
Date 2011-05-31 13:09 -0700
Organization Compilers Central
Message-ID <11-06-002@comp.compilers> (permalink)

Show all headers | View raw


Dear all,

   Given a program P in SSA form, let its dependence graph G = (V, E)
be a graph with a vertex nv for each variable v in P, and an edge
(na->nb) if b is defined by an instruction that uses a.

   If P is a general program with GOTOs, then it is possible to have a
graph G that is dense, i.e., has O(N^2) edges, where N is the number
of variables in P.

   However, if P contains only IF and WHILE, then it seems that the
number of edges in P will be O(N). Could you tell me if that is the
case? Otherwise, could you provide me a counter example?

   If I add a break with a label, or exceptions, like in Java, then I
am tempted to believe that the number of edges in the dependence graph
is still O(N). Could you tell me if this assumption is wrong?

Example:

Let L be a language with the following instructions:
x = ?; // Variable assignment
x = phi(x0, ..., xn) // phi function
if (?) {...} else {...}
print (x)

Let P be a program in L:

x0 = ?;
if (?) {
 x1 = ?;
}
x2 =phi (x0, x1)
print (x2);

Then P's dependence graph is:
x0 -> x2
x1 -> x2


Thank you very much,

Douglas

Back to comp.compilers | Previous | NextNext in thread | Find similar


Thread

Question about the structure of a program dependence graph Douglas do Couto Teixeira <douglasdocouto@gmail.com> - 2011-05-31 13:09 -0700
  Re: Question about the structure of a program dependence graph Andreas Zwinkau <zwinkau@kit.edu> - 2011-06-03 11:29 +0200
    Re: Question about the structure of a program dependence graph Douglas do Couto Teixeira <douglasdocouto@gmail.com> - 2011-06-05 11:22 -0300
      Re: Question about the structure of a program dependence graph Andreas Zwinkau <zwinkau@kit.edu> - 2011-06-06 10:37 +0200
  Re: Question about the structure of a program dependence graph George Neuner <gneuner2@comcast.net> - 2011-06-03 18:56 -0400

csiph-web