Re: [fpc-devel] Prototype optimisation... Sliding Window

2022-02-17 Thread J. Gareth Moreton via fpc-devel
That's useful to know, thanks.  Ideally I'd like to put it behind a kind of CSE compiler flag because this will add a degree of overhead to it and make compilation slower (currently I'm only doing it for -O3).  Currently I'm only tracking "mov (ref),%reg" and "lea (ref),%reg" instructions and w

Re: [fpc-devel] Prototype optimisation... Sliding Window

2022-02-17 Thread Jonas Maebe via fpc-devel
On 17/02/2022 20:25, J. Gareth Moreton via fpc-devel wrote: P.S. The term "sliding window" comes from the LZ77 compression algorithm and is used to track repeated sequences in ZIP files, among others. This prototype optimisation essentially uses the same construct, but built for instructions in

[fpc-devel] Prototype optimisation... Sliding Window

2022-02-17 Thread J. Gareth Moreton via fpc-devel
Hi everyone, So I've started experimenting with a new technique in the peephole optimizer for x86 platforms that I've named the Sliding Window.  The intention is to use it to help replace common blocks of code within a procedure, such as pointer dereferences.  So far I'm having a degree of su