pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Support for optimizing and emitting code in LLVM JIT provider.
Date: Thu, 22 Mar 2018 18:07:26 +0000
Message-ID: <E1ez4cY-00073B-Cj@gemulon.postgresql.org> (raw)

Support for optimizing and emitting code in LLVM JIT provider.

This commit introduces the ability to actually generate code using
LLVM. In particular, this adds:

- Ability to emit code both in heavily optimized and largely
  unoptimized fashion
- Batching facility to allow functions to be defined in small
  increments, but optimized and emitted in executable form in larger
  batches (for performance and memory efficiency)
- Type and function declaration synchronization between runtime
  generated code and normal postgres code. This is critical to be able
  to access struct fields etc.
- Developer oriented jit_dump_bitcode GUC, for inspecting / debugging
  the generated code.
- per JitContext statistics of number of functions, time spent
  generating code, optimizing, and emitting it.  This will later be
  employed for EXPLAIN support.

This commit doesn't yet contain any code actually generating
functions. That'll follow in later commits.

Documentation for GUCs added, and for JIT in general, will be added in
later commits.

Author: Andres Freund, with contributions by Pierre Ducroquet
Testing-By: Thomas Munro, Peter Eisentraut
Discussion: https://postgr.es/m/20170901064131.tazjxwus3k2w3ybh@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b96d550eb03cfdb000def70912ec840dbe7f67da

Modified Files
--------------
.gitignore                           |   1 +
src/Makefile.global.in               |  21 ++
src/backend/common.mk                |   1 +
src/backend/jit/jit.c                |   1 +
src/backend/jit/llvm/Makefile        |  14 +-
src/backend/jit/llvm/llvmjit.c       | 588 +++++++++++++++++++++++++++++++++++
src/backend/jit/llvm/llvmjit_types.c |  60 ++++
src/backend/utils/misc/guc.c         |  11 +
src/include/jit/jit.h                |  21 ++
src/include/jit/llvmjit.h            |  30 ++
src/tools/pgindent/typedefs.list     |   3 +
11 files changed, 748 insertions(+), 3 deletions(-)



Message-ID: <E1ez4cY-00073B-Cj@gemulon.postgresql.org>
Permalink:  ../E1ez4cY-00073B-Cj@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ez4cY-00073B-Cj@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de
  Subject: Re: pgsql: Support for optimizing and emitting code in LLVM JIT provider.
  In-Reply-To: <E1ez4cY-00073B-Cj@gemulon.postgresql.org>
  References: <E1ez4cY-00073B-Cj@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox