Thanks for your ideas!
I have learned essential lburg information. In fact, the MD
specification for DLX is almost finished! Thanks! lburg is a great
program.
Your suggestion on rewriting a new tree walker is very convincing.
Indeed, that will take care of the tightly-coupled LCC interface, and
may even introduce global optimizations. Also, restructuring the DAGs
to 3-address that the optimizations require allow easy manipulation
and reordering of the code.
However, my project is due in a few months. I think it's not feasible
to rewrite essential phases of lcc over again, with the need to code
advanced optimizations as well in such a short amount of time.
Maybe there's a faster, or easier way to do it? I've chosen LCC for my
front end because it's retargetable, and sup****ts a back end for MIPS,
which is very similar to DLX. Also, a "do***entation" in the form of a
book already exists, so I could learn about the design choices of the
authors without needing to second-guess their intentions. However,
problems arose when I tried to include optimizations. This is why I've
originally asked for a way to *tap* the code list and not cause
problems for the next phases after optimization. It's the most viable
alternative that I could see while planning out the schedule for my
project. But if there are other suggestions, I'm open to them.
Please keep your replies coming. Thanks!
Allan
> Hi Allan,
>
> While the AST LCC IR is suitable for optimizations like algebraic
> simplifications and CSE, it isn't generally very optimization
> friendly. You are better off writing a tree walker and emit your 3-
> address IR and write optimization p***** over them. In this case you
> will obviously lose the retagetability lburg provides, but mapping 3-
> address IR to DLX machine code should be fairly trivial. If you are
> adventurous you can use lburg as your tree walker and experiment
> writing an ir.md to emit your machine-independent 3-address IR into
> memory(with a few hacks in emitcode() I think - sorry it was a long
> time ago!). In this case, you still need to figure out how to create
> BB and CFG - this will need modifications in reduce() - everytime you
> hit a if-else or loop boundary etc you need to create new BB etc. You
> can write your optimizations, coloring allocator, list scheduler etc
> etc to work on this. All these are more hacks than clean solutions, so
> I think writing a tree walker and a new optimizing back-end is the
> best solution.
>
> Does gcc have an option to generate code for DLX? If so, you can write
> a C generating back end for lcc - c.md and compile it using gcc. This
> is only good if you need practice writing md files for lburg!
>
> T.


|