Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Peephole optimizations

4 views
Skip to first unread message

C. Kevin Mcintyre

unread,
Mar 6, 1987, 5:39:48 PM3/6/87
to
I am looking for some source/suggestions/clues/etc... (whatever) for
Peephole Optimizers. I have looked at the Aho Dragon book but it is
somewhat lacking in this area. As far as I can tell it is just a matter
of "string" matching and replacement. I am especially interested in how
the "big" compiler writing companies do their peephole optimizing if
any of them read this newsgroup. Any help will be greatly appreciated
and I will post the results/suggestions back to the net if the
interest is great enough.
--Thanks, Kevin.
Reply with any information to uucp path sdcsvax!hp-sdd!artecon!mcintyre
[All of the peepholers I ever fooled with were pretty standard pattern
matchers with some sort of data structure to let you move code around to
do tail merging and loop flipping. It also seems that about half of the
peephole transformations are quite machine independent, like removing
redundant moves or jumps to jumps, and the other half are completely machine
specific, like taking advantage of pecular address modes or loop closing
instructions. Feel free to cc: interesting responses to compilers. -John]
--
Send compilers articles to ima!compilers or, in a pinch, to Lev...@YALE.EDU
Plausible paths are { ihnp4 | decvax | cbosgd | harvard | yale | cca}!ima
Please send responses to the originator of the message -- I cannot forward
mail accidentally sent back to compilers. Meta-mail to ima!compilers-request

jo...@ima.uucp

unread,
Mar 11, 1987, 1:22:37 PM3/11/87
to
> [... It also seems that about half of the peephole transformations
> are quite machine independent, like removing ... jumps to jumps... -John]

This is something that confuses me about the compiler literature. Why
are jumps to jumps invariably removed in the peephole optimizer, when
it's so easy to generate code without them in the first place? You have
to parse a whole procedure at a time rather than generating on the fly,
but this is not a big deal...
--
David Eppstein, epps...@cs.columbia.edu, Columbia U. Computer Science Dept.
[Other peephole transformations like tail merging and loop inversion often
introduce jumps to jumps which have to be removed at peephole time anyway, so
you might as well do it all at peephole time. Also, I've found that the code
generation for things like short-circuit conditionals (&& and || in C) is
enough of a pain already without trying to do the de-jumping at the same time.

0 new messages