engineering recuitment NIC NIELIT Scientist B 2023 Mock Test Compiler Design Intermediate Code Generation Three Address Code
What will be optimized code when the expression \(p=q*-r+q+-r\) is represented in Directed Acyclic Graph(DAG) specification?
1
t1=-r , t2=q*t1 , t3=t1+t2 , p=t3
2
t1=-r , t2=q , t3=t1*t2 , t4=t3+t3 , p=t4
3
t1=-r , t2=q*t1 , t3=q*t1 , t4=t2+t3,p=t4
4
t1=-r , t2=q*t1 , t3=q+t1 , t4=t2+t3 , p=t4