4 ms·
It's easier for compilers to optimize. https://en.wikipedia.org/wiki/Static_single_assignment_form https://en.wikipedia.org/wiki/Static_single_assignment_form
by guerrilla 7y ago
It's easier for compilers to optimize. https://en.wikipedia.org/wiki/Static_single_assignment_form https://en.wikipedia.org/wiki/Static_single_assignment_form
- nn3 7y agoIt actually is not. The compiler has no problems turning your imperative code into SSA on its own, and PHI functions are no problem for optimizers. I guess it's just for readability and easier reasoning about the code.
- ternaryoperator 7y agoYou're not the OP of the comment, who is a compiler writer (C, C++, D). I hope he'll weigh in with his rationale.
- masklinn 7y agoAny MFA code is trivially converted to SSA and that's pretty much the first thing your compiler will do. So doing SSA by hand makes no real difference to the compiler unless your compiler is so trivial it doesn't start by converting its input to SSA.