Program optimization: Difference between revisions

Content deleted Content added
Tenbaset (talk | contribs)
m Disambig python
No edit summary
Line 145:
; ''dead code elimination'': Remove instructions that will not affect the behaviour of the program. For example in "int myFunc(int a){int b,c; b=a*2; c=a*3; return b;}" the statement "c=a*3" doesn't do anything useful and can be removed.
 
; ''using CPU instructions with complex offsets to do math'' : on many processors in the [[68000 family]], for example, "lea a0,25(a1,d5*4),a0" assigns to the a0 register 25 + the contents of a1 + 4 * the contents of d5 in a single instruction and without an explicit move or overwriting a1 or d5
 
; ''code-block reordering'': reduce conditional branches and improve [[locality of reference]]