Optimizer has been added to extend the compiler usability, cut down the amount of code generated and speed-up its execution. The main features are:
All expressions that can be evaluated in the compile time (i.e. constant) are being replaced by their results. (3 + 5 -> 8);
When a constant value is being assigned to a certain variable, the compiler recognizes this and replaces the use of the variable by constant in the code that follows, as long as the value of a variable remains unchanged.
The compiler recognizes that two variables have the same value and eliminates one of them further in the code.
The compiler "recognizes" if two expressions yield the same result and can therefore eliminate the entire computation for one of them.
"Dead code" ellimination
The code snippets that are not being used elsewhere in the programme do not affect the final result of the application. They are automatically removed.
Temporary registers ("Stacks") are being used more rationally, allowing VERY complex expressions to be evaluated with a minimum stack consumption.
Local vars optimization
No local variables are being used if their result does not affect some of the global or volatile variables.
Better code generation and local optimization
Code generation is more consistent and more attention is payed to implement specific solutions for the code "building bricks" that further reduce output code size.
What do you think about this topic ? Send us feedback!