Tuesday, March 22, 2016

What is a DAG for basic blocks? Construct the DAG for the following basic blocks

What is a DAG for basic blocks? Construct the DAG for the following basic blocks

DAG(Directed acyclic graph):   A Directed acyclic graph is a graph with no cycles which gives a picture of how the value computed by each statement in a basic block is used in subsequent statement in the block . That is,  a DAG has node for every sub-expression of the expression. An interior node represents n operator & its child represents an operand.

DAG is mainly used to identify the same expression.

Example:  Let us the following expression-
       a + a*(b-c)+(b-c)*d.

DAG for the expression is shown



Here given the basic block-
a := b+c   c : = b+c
b : = a-d   d : = a-d

So, the DAG is -
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Related Posts:

0 comments:

Post a Comment