EDDI Compiler 1.0.3 - Inlining and register allocation

The version 1.0.3 of the EDDI Compiler (eddic) is available.

The only improvement to the language is that the size of a global array can now be defined using a constant global variable.

The main improvement of this version is the addition of inlining in the optimization engine. This optimization replace a call to a function by the body of the function. For now, the inlining optimizer is quite basic. For now, it doesn't inline only a specific call site but all the call sites of a given function. Moreover, the heuristics used for inlining are quite simple (only the size of the function is taken into account). Only functions that takes int and float parameters can be inlined. This optimization will be improved in the future.

The second main change is the arrival of a basic register allocation. In each function, one or more variables can be assigned to registers. Only the most used variables are allocated into registers. Another optimization is that variables that are not used after all optimization techniques have been applied are removed from the function storage. The unused functions are also removed from the program after the optimization passes.

Moreover, the performances of optimization engine have been improved by about 20%.

The MTAC representation has been improved. The ARRAY operators have been removed because they can be replaced with the DOT operators. The preamble and prologue generations for LTAC has also been refactored. When it is possible, the stack frames are not generated.

Finally, the configuration of the compiler has been improved with several new optimization option and the options being separated into several option groups.

Future work

The next version of the EDDI Compiler will be the version 1.1.0.

The main change will be member functions inside of structures. For now, there will be no kind of virtual functions and inheritance but that will certainly come in its time.

And as ever, I will be more than pleased to hear any idea you could have about this project :)

Download

You can find the compiler sources on the Github repository: https://github.com/wichtounet/eddic

The exact version I refer to is the v1.0.3 available in the GitHub tags or directly as the release branch.

Comments

Comments powered by Disqus