in Unknown Category
3,554 views
7 votes
7 votes
What is the dtfference between static single assignment and 3 address code?
in Unknown Category
3.6k views

1 Answer

8 votes
8 votes
Best answer

Three-address code (often abbreviated to TAC or 3AC) is an intermediate code used by optimising compilers to aid in the implementation of code improvement and portability. Each TAC instruction has at most three operands and is typically a combination of assignment and a binary operator. For example, t1 := t2 + t3. The name derives from the use of three operands in these statements even though instructions with fewer operands may occur , just as in the case of TAC implementation of goto statements.

Single static assignment is a type of intermediate representation..But the  constraint is that each variable is assigned a value at most once but can be used any number of times..Only thing it has to be written once only..

Say  t1 = x + y , then 

        t2 = t1 + z , then if we write

        t1 = t1 + 3 , then it is an invalid SSA code as t1 is assigned second time which should not be the case..

selected by

Related questions