Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2021-12

Made improvements for the "extra optimisation information" feature

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

J. Gareth Moreton

Hi everyone,

I made some updates and cleaned things up with the "extra optimisation feature" I started to experiment with a while ago. Well, I've managed to find a better showcase for the feature (although it might need refactoring to speed the compiler up):
https://gitlab.com/freepascal.org/fpc/source/-/merge_requests/74

Under x86_64, I use the feature to leave 'hints' for the compiler on "mov %reg32,%reg32" instructions when a search has determined that the source register has its upper 32 bits set to zero.  This permits optimisations where the full 64 bits of the destination register are used later on because it knows that replacing it with the source register won't leave the upper 32 bits undefined.  This has a cascade effect and can cause the MOV to be deleted completely.

https://gitlab.com/freepascal.org/fpc/source/-/merge_requests/74

The compiler itself benefits from the feature a lot!  Excluding the 3 files with source changes, 38 units in the RTL and compiler combined show improvements, and as a result, the net growth of the x86_64-win64 compiler is only 2,048 bytes under -O4.

Gareth aka. Kit

This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

Reply by email