[llvm-commits] [PATCH] Reduce number of stubs used in 64bit code

Evan Phoenix evan at fallingsnow.net
Tue Sep 1 14:34:47 PDT 2009


Currently the JIT running on a x86_64 platform can only call an  
external function through a stub. This is because of a conservative  
decision about how the encoding of a pc-relative address would should  
up in the machine code stream. These stubs incur a penalty, so any  
stubs that can be eliminated should be.

The attached patch allows the JITEmitter to override the CodeGen's  
decision to use a stub by validating if a stub is actually needed.  
Thus any calling functions who's pc-relative offset fits directly in a  
call instruction are used the same as they would on a 32bit platform.

"Long" calls are still done via the stub mechanism.

This only effects the calling of externally defined functions. It  
changes nothing with regard to lazy/future JIT'd LLVM functions.

Thanks,

  - Evan Phoenix


-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm-64bit-stubs5.diff
Type: application/octet-stream
Size: 10154 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090901/258cdb43/attachment.obj>


More information about the llvm-commits mailing list