pgsql: jit: Add missing inline pass for LLVM >= 17.

Поиск
Список
Период
Сортировка
Искать

pgsql: jit: Add missing inline pass for LLVM >= 17.

От:
Thomas Munro <tmunro@postgresql.org>
Дата:
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" and
"default,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 
Reviewed-by: Thomas Munro 
Reviewed-by: Andreas Karlsson 
Reviewed-by: Andres Freund 
Reviewed-by: Álvaro Herrera 
Reviewed-by: Pierre Ducroquet 
Reviewed-by: Matheus Alcantara 
Discussion: https://postgr.es/m/CAO6_XqrNjJnbn15ctPv7o4yEAT9fWa-dK15RSyun6QNw9YDtKg%40mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/jit/llvm/llvmjit.c | 4 ++++
1 file changed, 4 insertions(+)

FAQ