Keil Logo

General Optimizations

  • Common Block Subroutines (Level 9)
    Recurring instruction sequences are detected and converted into subroutines. The Cx51 Compiler rearranges code to obtain larger recurring sequences.
  • Common Block Subroutines (Linker Optimization) (Level 9)
    Recurring instruction sequences are detected and converted into subroutines. The linker rearranges code to obtain larger recurring sequences.
  • Common Tail Merging (Level 8)
    When there are multiple calls to a single function, some of the setup code can be reused, thereby reducing program size.
  • Constant Folding (Level 0)
    The compiler performs calculations that reduce expressions to numeric constants, where possible. This includes calculations of run-time addresses.
  • Dead Code Elimination (Level 1)
    Unused code fragments, artifacts, and code which cannot be reached is removed.
  • Extended Index Access Optimizing (Level 7)
    DPTR is used for register variables where appropriate. Pointer and array access are optimized for both execution speed and code size.
  • Global Common Subexpression Elimination (Level 5)
    The compiler detects multiple uses of the same expression or subexpression within a function. The value is calculated only once and stored in a register for reuse where appropriate.
  • Jump Negation (Level 1)
    Conditional jumps are closely examined to see if they can be streamlined or eliminated by the inversion of the test logic.
  • Jump Optimizing (Level 0)
    The compiler always extends jumps to the final target. Jumps to jumps are eliminated.
  • Local Common Subexpression Elimination (Level 4)
    The compiler detects multiple uses of the same expression or subexpression. The value is calculated only once and reused where possible. Superfluous expression calculations are eliminated from the code.
  • Loop Rotation (Level 6)
    Program loops are rotated if the resulting program code is faster and more efficient. The loop expression of for and while loops is evaluated once at the top of the loop and then at the bottom of the loop. This optimization generates more code but speeds up execution.
  • Rearrange Code (Linker Optimization) (Level 10)
    When detecting common block subroutines, code is rearranged to obtain larger recurring sequences.
  • Register Variables (Level 4)
    Automatic variables and up to three function arguments may be located in registers. No data memory is reserved for variables located in registers.
  • Reuse of Common Entry Code (Linker Optimization) (Level 8)
    Entry code is reused when multiple calls are made to a single function. Reusing common entry code reduces program size.
  • Reuse of Common Exit Code (Linker Optimization) (Level 11)
    Identical exit sequences are reused. This may reduce the size of common block subroutines.
  • Simple Access Optimizing (Level 0)
    The compiler optimizes access of internal data and bit addresses in the 8051 system.
  • Simple Loop Optimizing (Level 4)
    Program loops that fill a memory range with a constant are converted and optimized.

Note

  • Linker optimizations are performed by the LX51 Linker only. The BL51 Linker does not perform any optimizations.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.