4 ms·
https://en.wikipedia.org/wiki/Static_single-assignment_form https://en.wikipedia.org/wiki/Static_single-assignment_form: “In compiler design, static single ass
by Someone 4y ago
https://en.wikipedia.org/wiki/Static_single-assignment_form https://en.wikipedia.org/wiki/Static_single-assignment_form:
“In compiler design, static single assignment form (often abbreviated as SSA form or simply SSA) is a property of an intermediate representation (IR) that requires each variable to be assigned exactly once and defined before it is used. Existing variables in the original IR are split into versions, new variables typically indicated by the original name with a subscript in textbooks”
You could have a language that doesn’t allow reassignment to variables, and let the compiler make that code performant by not reusing storage for values that won’t be referenced anymore.
- aappleby 4y agoSSA works great for keeping track of the old/newness of local variables inside a single function, but it doesn't really help with tracking old/newness of state variables (globals, heap values, stuff on the stack that persists through multiple calls to F) across function calls. You could in theory literally represent your program as a single giant function F that stores the entire program state as local variables and then apply SSA to that, but it would probably be a mess.