]> git.ipfire.org Git - thirdparty/postgresql.git/commit
jit: Add missing inline pass for LLVM >= 17.
authorThomas Munro <tmunro@postgresql.org>
Thu, 22 Jan 2026 02:43:13 +0000 (15:43 +1300)
committerThomas Munro <tmunro@postgresql.org>
Thu, 22 Jan 2026 03:10:58 +0000 (16:10 +1300)
commitf1c6b153cabdc9ea33c3396f13e1cee92836df75
tree042c4570d79543e76e1f8f83effec86765bc4664
parent3c83a2a0ace90a83249a51925706395c76a85bdf
jit: Add missing inline pass for LLVM >= 17.

With LLVM >= 17, transform passes are provided as a string to
LLVMRunPasses. Only two strings were used: "default<O3>" and
"default<O0>,mem2reg".

With previous LLVM versions, an additional inline pass was added when
JIT inlining was enabled without optimization. With LLVM >= 17, the code
would go through llvm_inline, prepare the functions for inlining, but
the generated bitcode would be the same due to the missing inline pass.

This patch restores the previous behavior by adding an inline pass when
inlining is enabled but no optimization is done.

This fixes an oversight introduced by 76200e5e when support for LLVM 17
was added.

Backpatch-through: 14
Author: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>
Reviewed-by: Thomas Munro <thomas.munro@gmail.com>
Reviewed-by: Andreas Karlsson <andreas@proxel.se>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Pierre Ducroquet <p.psql@pinaraf.info>
Reviewed-by: Matheus Alcantara <matheusssilv97@gmail.com>
Discussion: https://postgr.es/m/CAO6_XqrNjJnbn15ctPv7o4yEAT9fWa-dK15RSyun6QNw9YDtKg%40mail.gmail.com
src/backend/jit/llvm/llvmjit.c