postgresql/src/makefiles
Andres Freund 9370462e9a Add inlining support to LLVM JIT provider.
This provides infrastructure to allow JITed code to inline code
implemented in C. This e.g. can be postgres internal functions or
extension code.

This already speeds up long running queries, by allowing the LLVM
optimizer to optimize across function boundaries. The optimization
potential currently doesn't reach its full potential because LLVM
cannot optimize the FunctionCallInfoData argument fully away, because
it's allocated on the heap rather than the stack. Fixing that is
beyond what's realistic for v11.

To be able to do that, use CLANG to convert C code to LLVM bitcode,
and have LLVM build a summary for it. That bitcode can then be used to
to inline functions at runtime. For that the bitcode needs to be
installed. Postgres bitcode goes into $pkglibdir/bitcode/postgres,
extensions go into equivalent directories.  PGXS has been modified so
that happens automatically if postgres has been compiled with LLVM
support.

Currently this isn't the fastest inline implementation, modules are
reloaded from disk during inlining. That's to work around an apparent
LLVM bug, triggering an apparently spurious error in LLVM assertion
enabled builds.  Once that is resolved we can remove the superfluous
read from disk.

Docs will follow in a later commit containing docs for the whole JIT
feature.

Author: Andres Freund
Discussion: https://postgr.es/m/20170901064131.tazjxwus3k2w3ybh@alap3.anarazel.de
2018-03-28 13:19:08 -07:00
..
Makefile Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
Makefile.aix Fix PGXS support for building loadable modules on AIX. 2012-10-09 21:04:06 -04:00
Makefile.cygwin Try to fix non-MSVC Windows builds in the wake of logical replication. 2017-01-20 12:51:31 -05:00
Makefile.darwin Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
Makefile.freebsd Remove allow_nonpic_in_shlib 2012-12-18 01:13:59 -05:00
Makefile.hpux Remove support for Unix systems without the POSIX signal APIs. 2015-08-31 12:56:10 -04:00
Makefile.linux Always use -fPIC, not -fpic, when building shared libraries with gcc. 2017-06-01 13:32:55 -04:00
Makefile.netbsd Always use -fPIC, not -fpic, when building shared libraries with gcc. 2017-06-01 13:32:55 -04:00
Makefile.openbsd Always use -fPIC, not -fpic, when building shared libraries with gcc. 2017-06-01 13:32:55 -04:00
Makefile.solaris Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
Makefile.win32 Try to fix non-MSVC Windows builds in the wake of logical replication. 2017-01-20 12:51:31 -05:00
pgxs.mk Add inlining support to LLVM JIT provider. 2018-03-28 13:19:08 -07:00