Intermediate
Compilers & Programming Language Theory
Q78 / 100
What is a phi (φ) function used for in SSA-based intermediate representations?
Correct! Well done.
Incorrect.
The correct answer is D) It selects, at a control-flow merge point, which of several incoming SSA-renamed definitions of a variable should be used, depending on which predecessor block control came from
D
Correct Answer
It selects, at a control-flow merge point, which of several incoming SSA-renamed definitions of a variable should be used, depending on which predecessor block control came from
Explanation
When two branches each assign a different SSA version of a variable (x1 in one branch, x2 in the other), a phi-function x3 = φ(x1, x2) at the join point picks the correct version based on the predecessor block, preserving the single-assignment property while merging control flow.
Progress
78/100