[fpc-devel] Progress on reviewing x86_64 optimizer overhaul and node semantic pass

Florian Klämpfl florian at freepascal.org
Sat Oct 26 14:26:08 CEST 2019


Am 18.10.19 um 18:07 schrieb J. Gareth Moreton:
> Hi everyone,
> 
> How is everyone doing?  Sorry for my silence - been a bit tied up with 
> things in life.  Anyway, that aside, has there been any further progress 
> on reviewing the x86_64 optimizer overhaul over at 
> https://bugs.freepascal.org/view.php?id=34628? I ask because I've 
> sort-of blocked myself in any further improvements to the peephole 
> optimizer.

I had meanwhile a look at it and to be honest, I am against applying the 
remainders in its current form.
- First, the patches are inter-winded and the single patches do not 
cover one single topic. Today, using e.g. TortoiseGit on Windows (sorry, 
on Linux there is no tool which comes close) such patches can be 
re-arranged without too much hazzle.
- Breaking the principle of the multiple optimizer passes is reasonable 
on the one hand, on the other hand it makes complicated code even more 
complicated and in particular as only the optimizer benefits, I see no 
reason to do so. In particular in combination with using gotos, the 
price being payed regarding maintainability is very high.
- Also things like ConditionalJumpShortcut in aoptx86.pas containing arm 
and aarch64 defines does not convince me regarding the patches.
- Patches contains open todo: "TODO: FIXME removing the first 
instruction fails"

I would really like to see parts of the patch applied, but this requires 
that it is re-arranged in small, oversee-able changes.


More information about the fpc-devel mailing list