[fpc-devel] LLVM code generator

Jonas Maebe jonas at freepascal.org
Sun Feb 24 21:17:52 CET 2019


On 25/12/2018 19:14, Jonas Maebe wrote:
> On 2018-12-02 11:26, Jonas Maebe wrote:
> 
> The LLVM version of the code generator has been significantly improved 
> in the mean time:

The LLVM code generator on the debug_eh branch now also works with 
Linux/ARM, although only with the hard float EABI for now (compiler 
compiled with -dFPC_ARMHF).

Obligatory vipribench results (on gcc113.fsffrance.org, an APM X-Gene 
Mustang board -- that's an AArch64 board, but it can also run 32 bit ARM 
programs):
* FPC (-O2): Time: 5107ms = 2839240 pkts/s = 4245 MB/s
* FPC+LLVM (clang 7.0 -O2): Time: 5063ms = 3357693 pkts/s = 5020 M B/s

Higher optimization levels don't make a noticeable difference in either 
case.

Some notes about the FPC LLVM ARM Linux version:
* You have to use -Cg when compiling dynamic libraries, or they won't 
link (it's not necessary for all units, just for the main library source 
file)
* there are still a few bugs with bitpacked records that contain 64 bit 
values
* the compiler does not yet generate call frame information for the 
entry/exit code of assembler routines, which means that exceptions will 
not propagate through them and instead terminate the program 
immediately. In particular, overflow exceptions from 64 bit 
multiplication/division trigger this behaviour because they're 
implemented via assembler helpers in the RTL


Jonas



More information about the fpc-devel mailing list