Re: Data flow analysis and constant propagation

"Ben L. Titzer" <titzer@expert.ics.purdue.edu>
27 Apr 2003 02:25:07 -0400

          From comp.compilers

Related articles
Data flow analysis and constant propagation matt@beastrider.com (Matt) (2003-04-20)
Re: Data flow analysis and constant propagation dnovillo@redhat.com (Diego Novillo) (2003-04-27)
Re: Data flow analysis and constant propagation titzer@expert.ics.purdue.edu (Ben L. Titzer) (2003-04-27)
Re: Data flow analysis and constant propagation matt@peakfive.com (Matt) (2003-05-06)
| List of all articles for this month |
From: "Ben L. Titzer" <titzer@expert.ics.purdue.edu>
Newsgroups: comp.compilers
Date: 27 Apr 2003 02:25:07 -0400
Organization: Purdue University
References: 03-04-069
Keywords: analysis
Posted-Date: 27 Apr 2003 02:25:07 EDT

On 20 Apr 2003, Matt wrote:


> I built a module that's used for doing data flow analysis using a tree
> representation of the flow graph and I'm wondering how hard it is to use
> that tree for constant propagation, or if there are any descriptions of
> how to do this.
>
> The tree is built from an analysis of the flow graph and analyses like
> reaching definitions and live variables are done using attribution on
> the tree. The data flow analysis works well for this sort of thing but
> won't work for constant propagation. Since I already have the tree
> around and plenty of tools for developing attribution I'd like to do
> constant propagation with these tools.


If your module is powerful enough to dataflow analysis, then it should
be possible to perform constant propagation with it. Constant
propagation is just a special case of dataflow analysis where a
program point only has a single constant flow into it.


Are you using a context-sensitive or insensitive analysis? Both would work
for constant propagation, but context-sensitive will be more precise in
almost all cases (it will never be less precise).


What type of intermediate representation do you have? What type of
language is it (imperative or functional)? What control flow structures
does the language provide? Is your "dataflow tree" general enough to
capture precise dataflow information that arises from mutually recursive
functions and loops in the program? Cycles in the dataflow graph are where
the complexity comes from.


-B


Post a followup to this message

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