Question 11
Which data structure implementation of Three-Address Code contains four fields: op, arg1, arg2, and result?
A Quadruple is a record structure with 4 explicit fields: op, arg1, arg2, and result.
Which data structure implementation of Three-Address Code contains four fields: op, arg1, arg2, and result?
A Quadruple is a record structure with 4 explicit fields: op, arg1, arg2, and result.
What is the key difference between a Quadruple and a Triple representation in TAC?
Triples eliminate temporary variables by referring to the result of an operation via its position/index in the instruction array (fields: op, arg1, arg2).
What is a major drawback of using Triples for intermediate code optimization (like code motion/reordering)?
Because Triples refer to results via relative statement numbers, reordering instructions during optimization requires updating all index references. Indirect Triples solve this issue.
How do Indirect Triples solve the reordering problem of standard Triples during code optimization?
Indirect Triples store instructions in a fixed Triple list and use an auxiliary array of pointers. Code reordering modifies the pointer list without altering internal Triple relative references.
In a Directed Acyclic Graph (DAG) for an expression, what do the interior nodes and leaf nodes represent?
In an expression DAG, interior nodes correspond to operators while leaf nodes correspond to unique variable names or constant operands, identifying common subexpressions.