|Data flow analysis and constant propagation firstname.lastname@example.org (Matt) (2003-04-20)|
|Re: Data flow analysis and constant propagation email@example.com (Diego Novillo) (2003-04-27)|
|Re: Data flow analysis and constant propagation firstname.lastname@example.org (Ben L. Titzer) (2003-04-27)|
|Re: Data flow analysis and constant propagation email@example.com (Matt) (2003-05-06)|
|From:||"Ben L. Titzer" <firstname.lastname@example.org>|
|Date:||27 Apr 2003 02:25:07 -0400|
|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.
Return to the
Search the comp.compilers archives again.