in Compiler Design edited by
653 views
0 votes
0 votes

How does answer change when it is in SSA  form? does answer remains 4 or 5

in Compiler Design edited by
by
653 views

1 Answer

2 votes
2 votes
Best answer
Here last statement will not be executed. The main motive of DAG is elimination of common sub-expression.So, By only first two statements, I think your answer is also 4 nodes.
selected by

3 Comments

The main motive of DAG is elimination of common sub-expression. how?

does answer changes in SSA
0
0
In DAG, we never compute the already computed part. That is if a sub-expression is common, we don't have to compute it every time it occurs. We have to compute it only once and reuse it. Here c+d is already computed, so we will not compute it again.

I am sorry but I cannot say about SSA.
0
0
$d=c+d$ is unreachable code.
0
0