Re: Loop dependency analysis for C programs

"Robert H" <robert.hundt@gmail.com>
3 Dec 2006 21:33:05 -0500

          From comp.compilers

Related articles
Loop dependency analysis for C programs renjith.varma@gmail.com (renjith.varma@gmail.com) (2006-11-29)
Re: Loop dependency analysis for C programs DrDiettrich1@aol.com (Hans-Peter Diettrich) (2006-11-29)
Re: Loop dependency analysis for C programs renjith.varma@gmail.com (renjith.varma@gmail.com) (2006-11-30)
Re: Loop dependency analysis for C programs dima@rts.ua (Dmitry Marienko) (2006-12-01)
Re: Loop dependency analysis for C programs Sid.Touati@inria.fr (Sid Touati) (2006-12-01)
Re: Loop dependency analysis for C programs notme@nowhere.com (Paul Anderson) (2006-12-01)
Re: Loop dependency analysis for C programs neal.wang@gmail.com (neal) (2006-12-01)
Re: Loop dependency analysis for C programs robert.hundt@gmail.com (Robert H) (2006-12-03)
| List of all articles for this month |
From: "Robert H" <robert.hundt@gmail.com>
Newsgroups: comp.compilers
Date: 3 Dec 2006 21:33:05 -0500
Organization: Compilers Central
References: 06-11-11806-12-012
Keywords: analysis
Posted-Date: 03 Dec 2006 21:33:05 EST

Way too much work for just finding the loop structure.


You may want to look at this paper:
Paul Havlak, Nesting of reducible and irreducible loops, ACM
Transactions on Programming Languages and Systems (TOPLAS), v.19 n.4,
p.557-567, July 1997


There is also a correction by Ramalingam.


Or, simpler, just take a loop at natural loops in the dragon book ;-)


-- Robert


neal wrote:
> 1. Compute dominance relation of control flow graph.
> 2. Compute dominance frontiers.
> 3. Any node which has itself as its dominance frontier is a loop head
> node. All nodes dominated by the loop head node are within a loop.
> 4. After you know which nodes are in a loop, then you can infer the
> loop index variables.
>
> Just google dominance tree or dominance frontiers, you will find the
> papers about these algorithms.
>
> Neal
>
> On Nov 29, 11:07 pm, "renjith.va...@gmail.com"
> <renjith.va...@gmail.com> wrote:
> > Hans-Peter Diettrich wrote:
> > > renjith.va...@gmail.com wrote:
> >
> > > > I am planning to do loop dependency analysis for C programs. Could you
> > > > tell me the best way to get the loop structure?
> >
> > > You want to create an "control flow graph" (CFG). ...



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.