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

J. Gareth Moreton gareth at moreton-family.com
Sat Oct 26 16:47:52 CEST 2019

Hi Florian,

That seems like a fair assessment.  I'll see what I can do, especially 
as I have a design spec to go by, so maybe there's stuff to salvage and 

If I recall, there was a similar TODO in the current code and it just 
got moved, but I'll double-check that.

I've seen 'goto' used a few times in the code but wasn't sure what the 
policy was on that.  Generally I use a "repeat... until True;" loop with 
a "Continue;" - is that an okay substitution?

Since you're suggesting more bite-sized chunks, I think the first thing 
I'll do is overhaul the jump optimisations, since they caused 
significant improvements in places that are independent of reducing the 
optimiser passes.

Gareth aka. Kit

On 26/10/2019 13:26, Florian Klämpfl wrote:
> 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.
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

This email has been checked for viruses by Avast antivirus software.

More information about the fpc-devel mailing list