[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Small LAP peephole optimization

From: Ken Raeburn
Subject: Re: Small LAP peephole optimization
Date: Thu, 10 May 2007 16:10:30 -0400

On May 10, 2007, at 10:21, Dmitry Antipov wrote:
What do you think about such 'unsafe' optimizations in general ? As I know, some CL systems (such as from Franz) allows byte compiler to be very aggressive
at the cost of safety.

Generally, in the absence of either a directive from the code author saying such assumptions are valid, or some language spec (or other documentation readily available to the code authors) that says that such assumptions may be made in compilation, I don't think such optimizations to valid code are a good idea.

As I understand, branching to +0 is impossible if there is no TAG between
previous byteop an (byte-constant 0), so we might safely optimize the
sequences like

<numeric-on-top-op> (byte-constant 0) (byte-plus . 0) -> <numeric- on-top-op>

I'm not familiar with the representation of byte code in the compiler, but if labels are explicit in the sequence so that you can see that there isn't one there, then yes, that looks correct.

Less obvious cases are also interesting, but I'm not sure that saving 2 ops
might push someone to implement substantially more complex logic.

Right, probably not worthwhile, at least right now.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]