Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Static single-assignment form
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Benefits== The primary usefulness of SSA comes from how it simultaneously simplifies and improves the results of a variety of [[compiler optimization]]s, by simplifying the properties of variables. For example, consider this piece of code: y := 1 y := 2 x := y Humans can see that the first assignment is not necessary, and that the value of <code>y</code> being used in the third line comes from the second assignment of <code>y</code>. A program would have to perform [[reaching definition|reaching definition analysis]] to determine this. But if the program is in SSA form, both of these are immediate: y<sub>1</sub> := 1 y<sub>2</sub> := 2 x<sub>1</sub> := y<sub>2</sub> [[Compiler optimization]] algorithms that are either enabled or strongly enhanced by the use of SSA include: * [[Constant propagation]] β conversion of computations from runtime to compile time, e.g. treat the instruction <code>a=3*4+5;</code> as if it were <code>a=17;</code> * [[Value range propagation]]<ref>[http://llvm.org/devmtg/2007-05/05-Lewycky-Predsimplify.pdf value range propagation]</ref> β precompute the potential ranges a calculation could be, allowing for the creation of branch predictions in advance * [[Sparse conditional constant propagation]] β range-check some values, allowing tests to predict the most likely branch * [[Dead-code elimination]] β remove code that will have no effect on the results * [[Global value numbering]] β replace duplicate calculations producing the same result * [[Partial-redundancy elimination]] β removing duplicate calculations previously performed in some branches of the program * [[Strength reduction]] β replacing expensive operations by less expensive but equivalent ones, e.g. replace integer multiply or divide by powers of 2 with the potentially less expensive shift left (for multiply) or shift right (for divide). * [[Register allocation]] β optimize how the limited number of machine registers may be used for calculations
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)