Intermediate representation
Posted: Tue Jan 29, 2008 11:25 am
Hi,
I'm _trying_ to resume my CIL/JVM bytecode -> native compiler project. I'm in indecision about the intermediate representation to use for [future] optimizer plug ins to work on, and generate target code.
Currently I'm thinking of simple 3 address codes or so called quadruples with basic blocks [which is even partially implemented], with which sub-optimal code generation looks trivial.
As an alternative, regular binary trees can be used, which; I believe will provide more flexibility. We can even use basic blocks with each basic block as regular tree.
I've never worked on a compiler project before, nor have I really analyzed source of one. [well, I have looked at gcc & lcc sources, but they are way huge]. Thats where the indecision comes from.
Please enlighten me. I need that !
Thanks in advance
[I know, there is a lot of other stuff i need to worry about at the same time, like GC, threading, generics n the rest. I'm going by "Start slow, naive" law as they say ]
~Prashant
I'm _trying_ to resume my CIL/JVM bytecode -> native compiler project. I'm in indecision about the intermediate representation to use for [future] optimizer plug ins to work on, and generate target code.
Currently I'm thinking of simple 3 address codes or so called quadruples with basic blocks [which is even partially implemented], with which sub-optimal code generation looks trivial.
As an alternative, regular binary trees can be used, which; I believe will provide more flexibility. We can even use basic blocks with each basic block as regular tree.
I've never worked on a compiler project before, nor have I really analyzed source of one. [well, I have looked at gcc & lcc sources, but they are way huge]. Thats where the indecision comes from.
Please enlighten me. I need that !
Thanks in advance
[I know, there is a lot of other stuff i need to worry about at the same time, like GC, threading, generics n the rest. I'm going by "Start slow, naive" law as they say ]
~Prashant