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
Optimizing compiler
(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!
=== Data-flow optimizations === [[Dataflow|Data-flow]] optimizations, based on [[data-flow analysis]], primarily depend on how certain properties of data are propagated by control edges in the [[control-flow graph]]. Some of these include: ;[[Common subexpression elimination]]: In the expression <code>(a + b) - (a + b)/4</code>, "common subexpression" refers to the duplicated <code>(a + b)</code>. Compilers implementing this technique realize that <code>(a + b)</code> will not change, and so only calculate its value once.<ref name="aho-sethi-ullman" />{{rp|pages=592β594}} ;[[Constant folding|Constant folding and propagation]]: Replacing expressions consisting of constants (e.g., <code>3 + 5</code>) with their final value (<code>8</code>) at compile time, rather than doing the calculation in run-time.<ref name="MuchnickAssociates1997">{{cite book|author1=Muchnick|first=Steven|url=https://archive.org/details/advancedcompiler00much|title=Advanced Compiler Design Implementation|author2=Muchnick and Associates|date=15 August 1997|publisher=Morgan Kaufmann|isbn=978-1-55860-320-2|pages=[https://archive.org/details/advancedcompiler00much/page/329 329]β|quote=constant folding.|url-access=registration}}</ref> Used in most modern languages. ;[[Induction variable recognition and elimination]]: See discussion above about ''induction variable analysis''. ;[[Strict aliasing|Alias classification and pointer analysis]]: In the presence of [[pointer (computer programming)|pointer]]s, it is difficult to make any optimizations at all, since potentially any variable can have been changed when a memory location is assigned to. By specifying which pointers can alias which variables, unrelated pointers can be ignored. ;[[Dead store|Dead-store]] elimination: Removal of assignments to variables that are not subsequently read, either because the lifetime of the variable ends or because of a subsequent assignment that will overwrite the first value.
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)