[fpc-devel] Peephole optimizer tai class change proposals

Florian Klämpfl florian at freepascal.org
Sun Oct 17 16:00:02 CEST 2021

> Am 11.10.2021 um 10:00 schrieb J. Gareth Moreton via fpc-devel <fpc-devel at lists.freepascal.org>:
> One for Jonas mainly, but also for Florian.  This is a new "extra optimisation information" feature that allows the peephole optimizer to leave 'notes' and other extra information on individual tai objects for later reference.  An initial showcase is to store a link to the destination label if it's not available in the lookup table (becuase it was created later by a peephole optimisation).
> https://gitlab.com/freepascal.org/fpc/source/-/merge_requests/74/diffs
> Currently the showcase doesn't appear to show any additional optimisations in the x86-64 RTL because the jump optimisation that creates a new label is almost never called.
> I'll use this feature more extensively in the future, such as for storing information on the values of registers or making a note of a label that should be removed if possible because it would cause a long-term optimisation (something that a peephole optimisation that removes the label may not be able to determine because its own optimisation is questionable without that information).  See previous e-mails in this chain for an example.

I fear a little bit that this extra info is messed up when instructions are added/removed.

More information about the fpc-devel mailing list