Mark.Tucker@cmu-cs-gandalf.arpa (12/06/84)
Yes, its a shame that anyone who wants better code than the portable c compiler wants to give you has to start from scratch. A recent CACM talked about the Amsterdam compiler kit. They claim to build machine independent optimizers and machine dependent code generators for a nice tree-based intermediate language. Their intermediate representation is designed for optimization. I'd like to see a completely public domain C compiler built with their system. By starting with their stuff, you wouldn't need to worry about breaking 'old reliable.' Another publicly availible optimizer is PO, written by Jack Davidson (now at the University of Virginia). It takes register-transfer-level code descriptions and does nice value propogation / common sub-expression elimination. Unfortunately, it's slow, and doesn't work with trees, but seems to be easily retargeted to other machines. -- Mark Tucker
grunwald@uiucdcsb.UUCP (12/07/84)
As I hack away at a modified version of the Berkley Pascal compiler and look at the kind of code that is emitted by /lib/f1, I keep asking myself "Why didn't anyone build a better optimizer for the PPCIR?" Lets admit it, /lib/c2 gives a marginal improvement for programs generated by PC and F77. If there was an optimizer pass which did dataflow anaylsis shared code detecttion, and register assignment on the PCCIR forest of trees, it would be fairly machine independent, and I think that it would be fairly efficient too. Tweaking every compiler to include an optimizing phase, as was apparently done with F77, is too expensive. A filter before /lib/f1 is all that's really needed. Typically, C programs are not optimized on anything but the assembler level, but I think that an optimizer which did the optimizations mentioned would even be able to improve many a C program as well as PC and F77 programs. I'm certain that someone out that must have done this at some time in the past, particularly since optimizing heavily used utilities (CSH, troff, cc) might provide a substantial savings of CPU time. Tweaking a utility like this by hand is usually not worth the effort, but an optimizer should be able to get at least 5 -> 10% with the minimal effort of recompiling the utilties. I heard a that someone at Zilog had worked on something like this, and that someone at MIT might have something along the lines of what I'm looking for. Does anyone know if this is true and if any of this is in the public domain? What about the Graham-Glanville style code generators written at UCBerkley? Are they distributed and do they provide any significantly increased performance? I've only seen the articles in SIGPLAN Trans. on Comp. Const., an the figures made it appear that they give higher code-density. Dirk Grunwald University of Illinois, {pur-ee,ihnp4}!uiucdcs!grunwald UUCP domain grunwald.uiuc@Csnet-relay.CSNET Internet domain