1 votes 1 votes What is the Static Single Assignment (SSA) form for the following code segment: a = b+c; c = a+x; d = b+c; d = a+x; Should we use only 1 temporary variable for c=a+x and d=a+x because both of them evaluate the same expression finally? Compiler Design made-easy-test-series compiler-design intermediate-code static-single-assignment + – Heena Jain asked Nov 14, 2018 edited Mar 4, 2019 by akash.dinkar12 Heena Jain 1.7k views answer comment Share Follow See all 22 Comments See all 22 22 Comments reply Show 19 previous comments Heena Jain commented Nov 21, 2018 reply Follow Share @JEET we definitely cannot have two same variables on the left.... So i feel the answer should be 7. But I'm not sure whether we can optimize the code prior to converting it to SSA form. If we can, then the answer would be 6 otherwise 7 (according to me) 0 votes 0 votes `JEET commented Nov 21, 2018 reply Follow Share A guy told me that you can't optimize in SSA and but can optimize in DAG. Do someone have any authenticate content to read this topic. I didn't found anything in the Ulman as well. 0 votes 0 votes Deepak Poonia commented Dec 7, 2018 reply Follow Share But I'm not sure whether we can optimize the code prior to converting it to SSA form. No, You can not do the optimization before converting into SSA form. Optimization is a next phase of Intermediate Representation and SSA is a Type of IR which is widely used by various compilers because it makes various types of Optimizations easy like Dead Code Elimination, Constant Propagation etc. Answer will be : $a_0 = b_0+c_0;$ $c_1 = a_0+x_0;$ $d_0 = b_0+c_1;$ $d_1 = a_0+x_0;$ 5 votes 5 votes Please log in or register to add a comment.