Information
Unsupported content This version of the documentation is no longer supported. However, the documentation is available for your convenience. You will not be able to leave comments.

PSL Optimizer


The PSL Optimizer includes the following:

  • PSL Optimizer architecture
    • Three levels
    • Mutli-pass
    • Intermediate code optimizer
  • PSL Optimizer functions
  • Specifying options
    • Command line
    • Pragma PSL statement

Levels of Optimization

The PSL Optimizer supports the following levels:

  • 0 - no optimization
  • Level 1 (peephole) optimization
  • Level 2 (local) optimization
  • Level 3 (global) optimization

Level 1 Optimization

The following figures provide example code that illustrate Level 1 optimization. 

Level 1 - Remove Useless Jumps 

Level 1 - Remove Useless Jumps.gif

Level 1 - Reduce Jump Chains 

Level 1 - Reduce Jump Chains.gif

Level 1 - Remove Redundant Quad 

Level 1 - Remove Redundant Quad.gif

Level 1 - Pack Parameters 

Level 1 - Pack Parameters.gif

Level 2 Optimization

The following figures provide example code that illustrate Level 2 optimization. 

Level 2 - String joining 

Level 2 - String joining.gif

Level 2 - Fold and propagate 

Level 2 - Fold and propagate.gif

Level 2 - Remove Multiple and unused Definitions 

Level 2 - Remove Multiple and unused Definitions.gif

Level 2 - Reorder Parameters 

Level 2 - Reorder Parameters.gif

Level 3 Optimization

The following figures provide example code that illustrate Level 3 optimization. 

Level 3 - Remove Unreachable Code 

Level 3 - Remove Unreachable Code.gif

Level 3 - Reduce Block Chains 

Level 3 - Reduce Block Chains.gif

The Optimizer and Menu Commands

  • Menu commands are compiled for every execution (if in PSL source)
  • Optimization is by default 3 (version 3.2 and later)
    • Every time cost of optimization (which is expensive): pragma "O0" (O-zero)
    • Libraries: No cost

 

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC PATROL Agent 9.5