postgresql/src/include
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
..
access Store 2PC GID in commit/abort WAL recs for logical decoding 2018-03-28 17:42:50 +01:00
bootstrap Update copyright for 2018 2018-01-02 23:30:12 -05:00
catalog Add catversion bump missed in 16828d5c0. 2018-03-27 19:07:39 -07:00
commands Allow FOR EACH ROW triggers on partitioned tables 2018-03-23 10:48:22 -03:00
common restrict -> pg_restrict 2018-03-15 10:02:59 -03:00
datatype Update copyright for 2018 2018-01-02 23:30:12 -05:00
executor PL/pgSQL: Nested CALL with transactions 2018-03-28 13:31:27 -04:00
fe_utils Add \if support to pgbench 2018-03-22 17:42:03 +03:00
foreign Update copyright for 2018 2018-01-02 23:30:12 -05:00
jit Add inlining support to LLVM JIT provider. 2018-03-28 13:19:08 -07:00
lib Minor clean-up in dshash.{c,h}. 2018-03-01 16:25:46 -08:00
libpq Add ssl_passphrase_command setting 2018-03-17 08:28:51 -04:00
mb Update copyright for 2018 2018-01-02 23:30:12 -05:00
nodes Allow memory contexts to have both fixed and variable ident strings. 2018-03-27 16:46:51 -04:00
optimizer Implement partition-wise grouping/aggregation. 2018-03-22 12:49:48 -04:00
parser Allow UNIQUE indexes on partitioned tables 2018-02-19 17:40:00 -03:00
port Remove outdated/removed Win32 URLs in C comments 2018-01-09 18:33:21 -05:00
portability Update copyright for 2018 2018-01-02 23:30:12 -05:00
postmaster Fix more format truncation issues 2018-03-15 11:41:42 -04:00
regex Update copyright for 2018 2018-01-02 23:30:12 -05:00
replication Handle heap rewrites even better in logical decoding 2018-03-21 09:15:04 -04:00
rewrite Update copyright for 2018 2018-01-02 23:30:12 -05:00
snowball Update copyright for 2018 2018-01-02 23:30:12 -05:00
statistics Update copyright for 2018 2018-01-02 23:30:12 -05:00
storage Skip temp tables from basebackup. 2018-03-27 16:14:40 +03:00
tcop PL/pgSQL: Nested CALL with transactions 2018-03-28 13:31:27 -04:00
tsearch Update copyright for 2018 2018-01-02 23:30:12 -05:00
utils Allow memory contexts to have both fixed and variable ident strings. 2018-03-27 16:46:51 -04:00
.gitignore Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
c.h Fix interaction of Perl and stdbool.h 2018-03-23 10:31:10 -04:00
fmgr.h Add expression compilation support to LLVM JIT provider. 2018-03-22 14:45:59 -07:00
funcapi.h Support INOUT arguments in procedures 2018-03-14 12:07:28 -04:00
getaddrinfo.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
getopt_long.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
Makefile Add statistics subdirectory to Makefile. 2017-06-08 11:29:50 -04:00
miscadmin.h Mark assorted GUC variables as PGDLLIMPORT. 2018-02-09 15:54:45 -05:00
pg_config.h.in Add configure tests for stdbool.h and sizeof bool 2018-03-21 07:45:15 -04:00
pg_config.h.win32 Use stdbool.h if suitable 2018-03-22 20:42:25 -04:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.win32 Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pg_getopt.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pg_trace.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pgstat.h Support parallel btree index builds. 2018-02-02 13:32:44 -05:00
pgtar.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pgtime.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
port.h Use isinf builtin for clang, for performance. 2018-03-28 13:12:15 -07:00
postgres.h Move the extern declaration for ExceptionalCondition into c.h. 2018-02-14 19:43:33 -05:00
postgres_ext.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
postgres_fe.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
rusagestub.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
windowapi.h Update copyright for 2018 2018-01-02 23:30:12 -05:00