0 votes 0 votes How does answer change when it is in SSA form? does answer remains 4 or 5 Compiler Design compiler-design code-optimization directed-acyclic-graph numerical-answers ace-test-series + – thor asked Jan 22, 2017 • edited Nov 20, 2023 by Hira Thakur thor 679 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 2 votes 2 votes 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. Lucky sunda answered Jan 22, 2017 • selected Jan 22, 2017 by thor Lucky sunda comment Share Follow See all 3 Comments See all 3 3 Comments reply thor commented Jan 22, 2017 reply Follow Share The main motive of DAG is elimination of common sub-expression. how? does answer changes in SSA 0 votes 0 votes Lucky sunda commented Jan 23, 2017 reply Follow Share 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 votes 0 votes Hira Thakur commented Nov 20, 2023 reply Follow Share $d=c+d$ is unreachable code. 0 votes 0 votes Please log in or register to add a comment.