EDDI Compiler 1.0.2 – Better pointer support and Dead-Code Elimination

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

The language itself does not features something new, but the support of pointers has been greatly improved. You can now declare arrays of pointers and return pointers from functions. Structures can hold pointers as well. Moreover, arrays of structures are now supported. These new features have increased the number of operators of the MTAC Level.

The more important part of this new version resides in the Optimization Engine. A new optimization technique has been implemented: Dead-Code Elimination. This technique removes all code that calculates values for variables that are not used anymore after this statement. Another change is that empty functions are removed after optimization (as well as every call to the removed functions). The liveness analyzer has been replaced by a global Live-Variable Analysis routine. This information is used in the optimization engine and in the LTAC Compiler. Finally, the Peephole Optimizer has been improved to support some local optimization techniques like constant propagation and basic dead-code elimination.

The code generators have also been improved by outputting only native functions that are called. It means that if the program does not print a float, the _F5printF function will not be generated. Moreover, the native functions have been moved in external assembly files.

Future work

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

This version will see a first basic version of Inlining optimization and certainly register-allocation of the most used variables. There will certainly be no change of the language itself.

A cleanup of the two compilers (MTAC and LTAC) will be performed as well as simplification of the MTAC Language if possible.

The other changes will mainly be minor changes to the compiler.

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


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.2 available in the GitHub tags or directly as the release branch.

Related articles

  • EDDI Compiler 1.0.1 - Pointers and better struct support
  • EDDI Compiler 1.0.3 - Inlining and register allocation
  • EDDI Compiler 1.1.0 - Member functions
  • EDDI Compiler 1.0 - Structures and Global Optimizations
  • EDDI Compiler 1.1.3 - Templates
  • EDDI Compiler 1.1.4 – Graph Coloring Register Allocation
  • Comments

    Comments powered by Disqus