Compilers
Which is a characteristic of an IR in SSA form?
- AEach variable is assigned exactly once in the program
- BAll variables are placed in memory rather than registers
- CIt is rewritten so it contains no conditional branches at all
Show answer and explanation
Answer: A. Each variable is assigned exactly once in the program
In SSA form, variables are renamed so each is assigned only once, and φ functions select values at join points. If x is assigned twice, for example, it is split into x1 and x2, making clear which one each use refers to. The clear definition-use relationships make optimizations such as constant propagation and dead-code elimination easier. Branches are handled with φ functions, so branch instructions do not disappear. Variables are not forced into memory; most are treated as register candidates.
- A. Correct. Variables are renamed so each is assigned once.
- B. It is not a form that places variables in memory.
- C. Branches remain; join points are handled with φ functions.