Optimization

Home Products Sales Support Contacting Us Library Search

Jovial
What is GCC
Optimization

 

Optimization

In XGC compilers, the general strategy is to general compact code. Usually this results in the fast code too. But note that at optimization level 3, many functions will be in-lined and the code size will increase. Optimization level 2 is a good project default.

The optimizations performed include the following:

bulletAutomatic register allocation
bulletCommon sub-expression elimination
bulletInvariant code motion from loops
bulletInduction variable optimizations
bulletConstant propagation and copy propagation
bulletDelayed popping of function call arguments
bulletTail recursion elimination
bulletIntegration of in-line functions & frame pointer elimination
bulletInstruction scheduling
bulletLoop unrolling
bulletLeaf function optimization
bulletOptimized multiplication by constants
bulletPeephole

The compiler uses a pattern matching technique to select the best instruction for each of hundreds of different cases. For example in the 1750 code generator, setting the value of a one-bit bit field to a known value will nearly always use the set bit or reset bit instructions.

Usually optimization makes the generated code easier to read. We recommend that projects adopt the optimization default of level2.

 

Updated May 11, 2005
Copyright XGC Software