2018-03-22 03:28:28 +01:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Makefile--
|
|
|
|
# Makefile the LLVM JIT provider, building it into a shared library.
|
|
|
|
#
|
|
|
|
# Note that this file is recursed into from src/Makefile, not by the
|
|
|
|
# parent directory..
|
|
|
|
#
|
|
|
|
# IDENTIFICATION
|
|
|
|
# src/backend/jit/llvm/Makefile
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
subdir = src/backend/jit/llvm
|
|
|
|
top_builddir = ../../../..
|
|
|
|
include $(top_builddir)/src/Makefile.global
|
|
|
|
|
|
|
|
ifneq ($(with_llvm), yes)
|
|
|
|
$(error "not building with LLVM support")
|
|
|
|
endif
|
|
|
|
|
|
|
|
PGFILEDESC = "llvmjit - JIT using LLVM"
|
|
|
|
NAME = llvmjit
|
|
|
|
|
2019-06-17 09:13:16 +02:00
|
|
|
# All files in this directory use LLVM.
|
2018-03-22 03:28:28 +01:00
|
|
|
CFLAGS += $(LLVM_CFLAGS)
|
|
|
|
CXXFLAGS += $(LLVM_CXXFLAGS)
|
|
|
|
override CPPFLAGS := $(LLVM_CPPFLAGS) $(CPPFLAGS)
|
|
|
|
SHLIB_LINK += $(LLVM_LIBS)
|
|
|
|
|
|
|
|
# Because this module includes C++ files, we need to use a C++
|
|
|
|
# compiler for linking. Makefile.shlib uses $(COMPILER) to build
|
|
|
|
# loadable modules.
|
|
|
|
override COMPILER = $(CXX) $(CFLAGS)
|
|
|
|
|
|
|
|
OBJS=$(WIN32RES)
|
|
|
|
|
|
|
|
# Infrastructure
|
2018-03-28 22:19:08 +02:00
|
|
|
OBJS += llvmjit.o llvmjit_error.o llvmjit_inline.o llvmjit_wrap.o
|
2018-03-22 03:28:28 +01:00
|
|
|
# Code generation
|
2018-03-26 21:57:19 +02:00
|
|
|
OBJS += llvmjit_expr.o llvmjit_deform.o
|
2018-03-22 03:28:28 +01:00
|
|
|
|
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
2018-03-22 19:05:22 +01:00
|
|
|
all: all-shared-lib llvmjit_types.bc
|
2018-03-22 03:28:28 +01:00
|
|
|
|
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
2018-03-22 19:05:22 +01:00
|
|
|
install: all installdirs install-lib install-types
|
2018-03-22 03:28:28 +01:00
|
|
|
|
|
|
|
installdirs: installdirs-lib
|
|
|
|
|
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
2018-03-22 19:05:22 +01:00
|
|
|
uninstall: uninstall-lib uninstall-types
|
|
|
|
|
|
|
|
# Note this is intentionally not in bitcodedir, as it's not for inlining */
|
|
|
|
install-types: llvmjit_types.bc
|
|
|
|
$(INSTALL_DATA) llvmjit_types.bc '$(DESTDIR)$(pkglibdir)'
|
|
|
|
|
|
|
|
uninstall-types:
|
|
|
|
rm -f '$(DESTDIR)$(pkglibdir)/llvmjit_types.bc'
|
2018-03-22 03:28:28 +01:00
|
|
|
|
|
|
|
include $(top_srcdir)/src/Makefile.shlib
|
|
|
|
|
|
|
|
clean distclean maintainer-clean: clean-lib
|
|
|
|
rm -f $(OBJS)
|
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
2018-03-22 19:05:22 +01:00
|
|
|
rm -f llvmjit_types.bc
|