Questions tagged [data-flow-analysis]

37 questions
7
votes
1 answer

When is it useful to split critical edges?

Some compilers have utility functions that split critical edges in the control flow graph. I assume that this is not done as an optimization in itself, but rather to simplify other analyses and transformations. In what cases would splitting critical…
zr.
  • 171
  • 2
6
votes
1 answer

Memory needed for computational graph

Suppose we have a set of equations like this p7=f(p1+p6); p6=f(p2+p5); p5=f(p3+p4); p4=f(p3); p3=f(p2); p2=f(p1); p1=f() It can be represented by computational graph below If each intermediate value takes 1 unit of memory, you need at least 4…
6
votes
1 answer

Backward data-flow: post-order or RPO on reverse CFG?

When solving backward data-flow problems, many resources (Wikipedia and many presentations found online) recommend traversing the control-flow graph (CFG) in post-order for fastest convergence, which makes sense. Other resources (such as the…
6
votes
1 answer

Difference between "data dependence graph", "data dependency graph", and "data flow graph"

Is there a difference between a "data dependence graph" and a "data dependency graph"? I have seen both terms - sometimes used interchangeably sometimes not. To make things even more complicated, a "data dependency graph" is sometimes also called a…
4
votes
1 answer

Backward vs Forward Data-flow Analysis

I understand how both forward and backward data-flow analysis work but in what situations would we use them? Why do we need to be able to do it in both ways? Do compilers of certain types perform one way more efficiently than the other?
Haych
  • 534
  • 6
  • 20
4
votes
1 answer

What are GEN and KILL statements in dataflow analysis?

In data flow analysis, is GEN statement where a variable is used and KILL statement is where variable is redefined?
4
votes
1 answer

Can reading a value of a variable kill the definition of the variable?

I was going through the concept of reaching definitions from the red dragon book. The authors define reaching definitions as follows: Definition: We say a definition $d$ reaches a point $p$ if there is a path from the point immediately following…
Abhishek Ghosh
  • 1,184
  • 9
  • 24
4
votes
1 answer

Which language is used to construct a type system?

Typically, OCaml and Scala seem to be used for designing any programming languages tool. But what features offer them an edge over other languages. A related question, is a type system for a language always written in the native language itself?
3
votes
3 answers

Formal notion of a call graph for Turing machines

To most computer programs one can assign a "call graph". Is there a formal notion of call graphs of Turing machines? Motivation is, that one could intuitively call a decidable language $L$ "irreducible" if every Turing machine which decides $L$ has…
user41014
3
votes
1 answer

Dataflow Analysis: Available Expressions, why is OUT[B] initialized to universal set?

In the dragon book, section 9.2.6, why is the $OUT[B]$ initialized to $U$ except for $OUT[ENTRY]$. Wouldn't using the $OUT[B] = \emptyset \quad \forall B$ be a more conservative solution? The book gives this example: Let $IN[B_2] = OUT[B_1] \cap…
David Yue
  • 133
  • 4
2
votes
0 answers

Calculation of Gen and Kill set for data flow analys

I'm currently preparing for an exam in compiler construction. The course is mainly about optimization in the backend of the compiler. For the optimization we have to do data flow analysis by hand. In one example I do not understand how gen and kill…
mdxg
  • 21
  • 4
2
votes
1 answer

Why is it better to do the data flow analysis in the basic blocks

I have been reading about compilers and it is said that doing the data flow analysis in the basic blocks is more optimal. Sadly, quoting the exact source, would be slightly hard as it is not in English, but a quote from wikipedia can also be…
dsax7
  • 157
  • 5
2
votes
0 answers

Novel escape analysis algorithm for Java

Today I read a very interesting article about escape analysis in Java called Escape Analysis for Object Oriented Languages: Application to Java I think I have some grasp on how escape analysis works and how it is implemented, but I don't understand…
2
votes
2 answers

Inferring used fields in return type

A common issue in app development is avoiding over-fetching of data, such as in this naive (pseudocode) example: get_user(id) { return sql_query("SELECT * FROM users WHERE id=$1", id); } render_some_webpage() { // ... print…
2
votes
1 answer

Cut costly functions in inter-procedural abstract interpretation

I am performing some inter-procedural abstract interpretation to capture certain program properties. Following the standard way, what I am doing is to maintain a work list of to-be-analyzed functions, and pick one from the work list to perform…
1
2 3