3 ms·
Static single assignment is a property of an intermediate representation, the language used by the front-end of the compiler (the part that handles a specific l
by chaosite 4y ago
Static single assignment is a property of an intermediate representation, the language used by the front-end of the compiler (the part that handles a specific language, parsing, semantics, and whatnot) to the back-end of the compiler (the part that handles a specific architecture, emitting assembler instructions as well as optimizations).
One of the tricks of making compilers is transforming the code into whatever form makes the thing you're trying to do easier. SSA is one of those forms, and it means that each variable has exactly one assignment. There is some "cheating" (phi nodes) involved to handle things like "if (...) { a = 0 } else { a = 1 }".
Notably, LLVM IR is SSA.
Since there's no mutation, it's technically a functional language.
- chrisweekly 4y agoThanks! TIL.