Re: [cc65] Optimization possible?

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2009-10-24 20:14:09
On Sat, Oct 24, 2009 at 07:59:13PM +0200, Groepaz wrote:
> mmmmh, is that optimizer purely rule based?

I'm not sure what you mean with that. It's code, so there are definitely
rules. But this is probably not what you're talking about.

The code generator stores the code in an abstract form. Several other parts
supply more information. As an example, for each instruction (even subroutine
calls if possible), information about register usage is collected. The backend
knows which registers are used and which ones are destroyed. On request (for
steps that need it), information about register and zero page contents is
generated. As posted a few days ago, this takes also branches into account. If
the contents of a register have the same value in all execution paths leading
to some line of code, the backend knows the value at this point. And so on ...

> if yes, maybe adding something
> like daniel dallmanns opt65 could improve the result a bit? (although i
> remember running it on cc65 compiled stuff long ago, and it didnt really find
> anything).

I think you won't have much success with opt65. For one, the cc65 backend
doesn't work on assembler text. This is one of the first things I dropped,
since it complicates things a lot. Next it knows values of registers and can
tell if - at a certain point - a register value is used later or not.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sat Oct 24 20:22:08 2009

This archive was generated by hypermail 2.1.8 : 2009-10-24 20:22:10 CEST