From: Andres Freund <andres@anarazel.de>
To: pgsql-hackers@postgresql.org
Subject: Re: JIT compiling - v4.0
Date: Tue, 3 Oct 2017 23:48:09 -0700
Message-ID: <20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de> (raw)
In-Reply-To: <20170901064131.tazjxwus3k2w3ybh@alap3.anarazel.de>
References: <20170901064131.tazjxwus3k2w3ybh@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Hi,
Here's an updated version of the patchset. There's some substantial
changes here, but it's still very obviously very far from committable as
a whole. There's some helper commmits that are simple and independent
enough to be committable earlier on.
The git tree of this work, which is *frequently* rebased, is at:
https://git.postgresql.org/gitweb/?p=users/andresfreund/postgres.git;a=shortlog;h=refs/heads/jit
The biggest changes are:
- The JIT "infrastructure" is less bad than before, and starting to
shape up.
- The tuple deforming logic is considerably faster than before due to
various optimizations. The optimizations are:
- build deforming exactly to the required natts for the specific caller
- avoid checking the tuple's natts for attributes that have
"following" NOT NULL columns.
- a bunch of minor codegen improvements.
- The tuple deforming codegen also got simpler by relying on LLVM to
promote a stack variable to a register, instead of working with a
register manually - the need to keep IR in SSA form makes doing so
manually rather painful.
- WIP patch to do execGrouping.c TupleHashTableMatch() via JIT. That
makes the column comparison faster, but more importantly it JITs the
deforming (one side at least always is a MinimalTuple).
- All tests pass with JITed expression, tuple deforming, agg transition
value computation and execGrouping logic. There were a number of bugs,
who would have imagined that.
- some more experimental changes later in the series to address some
bottlenecks.
Functionally this covers all of what I think a sensible goal for v11
is. There's a lot of details to figure out, and the inlining
*implementation* isn't what I think we should do. I'll follow up, not
tonight though, with an email outlining the first few design decisions
we're going to have to finalize, which'll be around the memory/lifetime
management of functions, and other infrastructure pieces (currently
patch 0006).
As the patchset is pretty large already, and not going to get any
smaller, I'll make smaller adjustments solely via the git tree, rather
than full reposts.
Greetings,
Andres Freund
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackersAttachments:
[application/x-patch-gzip] 0001-Rely-on-executor-utils-to-build-targetlist-for-DM.v4.patch.gz (1.0K, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/2-0001-Rely-on-executor-utils-to-build-targetlist-for-DM.v4.patch.gz)
download
[application/x-patch-gzip] 0002-WIP-Allow-tupleslots-to-have-a-fixed-tupledesc-us.v4.patch.gz (11.9K, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/3-0002-WIP-Allow-tupleslots-to-have-a-fixed-tupledesc-us.v4.patch.gz)
download
[application/x-patch-gzip] 0003-Perform-slot-validity-checks-in-a-separate-pass-o.v4.patch.gz (3.3K, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/4-0003-Perform-slot-validity-checks-in-a-separate-pass-o.v4.patch.gz)
download
[application/x-patch-gzip] 0004-Pass-through-PlanState-parent-to-expression-insta.v4.patch.gz (1.4K, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/5-0004-Pass-through-PlanState-parent-to-expression-insta.v4.patch.gz)
download
[application/x-patch-gzip] 0005-Add-configure-infrastructure-to-enable-LLVM.v4.patch.gz (2.3K, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/6-0005-Add-configure-infrastructure-to-enable-LLVM.v4.patch.gz)
download
[application/x-patch-gzip] 0006-Beginning-of-a-LLVM-JIT-infrastructure.v4.patch.gz (6.8K, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/7-0006-Beginning-of-a-LLVM-JIT-infrastructure.v4.patch.gz)
download
[application/x-patch-gzip] 0007-JIT-compile-expressions.v4.patch.gz (12.5K, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/8-0007-JIT-compile-expressions.v4.patch.gz)
download
[application/x-patch-gzip] 0008-Centralize-slot-deforming-logic-a-bit.v4.patch.gz (2.4K, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/9-0008-Centralize-slot-deforming-logic-a-bit.v4.patch.gz)
download
[application/x-patch-gzip] 0009-WIP-Make-scan-desc-available-for-all-PlanStates.v4.patch.gz (789B, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/10-0009-WIP-Make-scan-desc-available-for-all-PlanStates.v4.patch.gz)
download
[application/x-patch-gzip] 0010-JITed-tuple-deforming.v4.patch.gz (6.8K, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/11-0010-JITed-tuple-deforming.v4.patch.gz)
download
[application/x-patch-gzip] 0011-Simplify-aggregate-code-a-bit.v4.patch.gz (2.8K, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/12-0011-Simplify-aggregate-code-a-bit.v4.patch.gz)
download
[application/x-patch-gzip] 0012-More-efficient-AggState-pertrans-iteration.v4.patch.gz (1.3K, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/13-0012-More-efficient-AggState-pertrans-iteration.v4.patch.gz)
download
[application/x-patch-gzip] 0013-Avoid-dereferencing-tts_values-nulls-repeatedly-i.v4.patch.gz (964B, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/14-0013-Avoid-dereferencing-tts_values-nulls-repeatedly-i.v4.patch.gz)
download
[application/x-patch-gzip] 0014-WIP-Expression-based-agg-transition.v4.patch.gz (14.7K, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/15-0014-WIP-Expression-based-agg-transition.v4.patch.gz)
download
[application/x-patch-gzip] 0015-Hacky-Preliminary-inlining-implementation.v4.patch.gz (4.9K, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/16-0015-Hacky-Preliminary-inlining-implementation.v4.patch.gz)
download
[application/x-patch-gzip] 0016-WIP-Inline-ExecScan-mostly-to-make-profiles-easie.v4.patch.gz (4.8K, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/17-0016-WIP-Inline-ExecScan-mostly-to-make-profiles-easie.v4.patch.gz)
download
[application/x-patch-gzip] 0017-WIP-Do-execGrouping.c-via-expression-eval-machine.v4.patch.gz (4.9K, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/18-0017-WIP-Do-execGrouping.c-via-expression-eval-machine.v4.patch.gz)
download
[application/x-patch-gzip] 0018-WIP-deduplicate-int-float-overflow-handling-code.v4.patch.gz (1.9K, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/19-0018-WIP-deduplicate-int-float-overflow-handling-code.v4.patch.gz)
download
[application/x-patch-gzip] 0019-Make-timestamp_cmp_internal-an-inline-function.v4.patch.gz (800B, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/20-0019-Make-timestamp_cmp_internal-an-inline-function.v4.patch.gz)
download
[application/x-patch-gzip] 0020-Make-hot-path-of-pg_detoast_datum-an-inline-funct.v4.patch.gz (880B, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/21-0020-Make-hot-path-of-pg_detoast_datum-an-inline-funct.v4.patch.gz)
download
[application/x-patch-gzip] 0021-WIP-Inline-additional-function.v4.patch.gz (703B, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/22-0021-WIP-Inline-additional-function.v4.patch.gz)
download
[application/x-patch-gzip] 0022-WIP-Faster-order.v4.patch.gz (640B, ../20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de/23-0022-WIP-Faster-order.v4.patch.gz)
download
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: andres@anarazel.de
Subject: Re: JIT compiling - v4.0
In-Reply-To: <20171004064809.qe45ejsixgmfxd5r@alap3.anarazel.de>
* 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