0 0 votes Given the 3-address code for a basic block: The number of registers that are needed to allocate this basic block with no spills are ________.? My doubt here is : Is there any difference in question asking for minimum numbers of registers and minimum number of variables required for 3 address code? Can’t we optimize the above code using code motion? If the question ask only for number of variables required in three address code ! do we need to optimize before counting? If the question ask for minimum number of variables required in three address code, Only then should we optimize the code before counting? Compiler Design compiler-design three-address-code made-easy-test-series numerical-answers + – Shivam Kasat 1.9k views answer comment Share Follow Print See all 7 Comments 7 7 Comments reply Show 4 previous comments srestha commented Dec 23, 2018 reply Follow flag @Shaik Masthan how 2? At first here we are storing a,b,c,d in 4 registers right? 0 0 replyShare Prateek Raghuvanshi commented Dec 23, 2018 reply Follow flag @ srestha there is no need of storing a,b,c,d into registers ,because load instructions are there so we loading data from memory location to register so need of storing . 0 0 replyShare smsubham commented Dec 24, 2019 reply Follow flag $2$ is minimum. $T1 = a + b$ $T2 = T1 + c$ $T1 = T2 + d$ (we don't need a + b again so we can use T1) $a = T1$ 1 1 replyShare Please log in or register to add a comment.
1 1 vote t1=a+b t1=t1+c t1=t1+d a=t1 debmalyaSEN answered Oct 8, 2020 debmalyaSEN comment Share Follow 0 reply Please log in or register to add a comment.