Commit Graph

26 Commits

Author SHA1 Message Date
alesapin
55fc095c98 Fix big dates comparison with compile expressions (Date and DateTime are not signed types anymore). 2019-02-11 17:36:54 +03:00
alesapin
748bcb0a3c Remove accident changes 2019-01-12 00:18:57 +03:00
alesapin
00200615e8 Trying to remove redundant objects from CompiledExpressionsCache (LLVMFunction), also remove CompiledExpressionsCacheBytes metric because it's not connected with real size 2019-01-12 00:16:49 +03:00
Alexey Milovidov
7d6365d139 LLVM compiler: better exception messages [#CLICKHOUSE-2] 2018-10-11 23:31:41 +03:00
Nikolai Kochetov
d526859011 Added cache for low cardinality function result. [#CLICKHOUSE-3904] 2018-09-25 16:48:52 +03:00
alesapin
e815260363 CLICKHOUSE-3800: Improve cache and turn on compilation by default 2018-09-07 23:17:40 +03:00
alesapin
a7bd2b42e8 CLICKHOUSE-3800: Review fixes 2018-09-03 13:14:05 +03:00
alesapin
ac6ab62c6f CLICKHOUSE-3800: Remove use after free of context 2018-08-31 13:27:08 +03:00
alesapin
6e64067a70 CLICKHOUSE-3800: Move cache to context, change hashing algorithm, add drop instruction for compiled expressions cache 2018-08-30 19:31:20 +03:00
alesapin
06adf19053 CLICKHOUSE-3800: Remove tab 2018-08-29 20:51:23 +03:00
alesapin
1a85271702 CLICKHOUSE-3800: Add expression cache 2018-08-28 20:06:42 +03:00
Alexey Milovidov
c4a26764ce Miscellaneous #2277 2018-05-06 12:32:36 +03:00
pyos
4641e2960f Move ExpressionActions::compileFunctions to ExpressionJIT.cpp.
This means ExpressionJIT.h only has to expose one function.
2018-04-29 13:39:01 +03:00
pyos
979c4d959f Let jit-compilable functions deal with NULLs themselves.
And provide a default implementation of compile() for nullable columns
that actually works and is consistent with execute().
2018-04-28 00:34:27 +03:00
pyos
49b61cd27d Refactor LLVMFunction to make extending to DataTypeNullable easier 2018-04-27 18:44:38 +03:00
pyos
b4d527ee85 Inline compile-time constants into jitted functions. 2018-04-26 14:30:16 +03:00
pyos
854f85dd9b Put #if USE_EMBEDDED_COMPILER in ExpressionJIT.{cpp,h} 2018-04-25 18:19:22 +03:00
pyos
5482282943 Implement informational methods for LLVMFunction 2018-04-25 16:01:06 +03:00
pyos
162a0c8b33 Fix some comments' style 2018-04-25 16:01:06 +03:00
pyos
1bece1de46 Support nullable columns (with default behavior) in jitted functions 2018-04-25 13:37:26 +03:00
pyos
4bd0906613 Fix some comments 2018-04-25 13:37:26 +03:00
pyos
3810173103 Remove IFunction::createResultColumn.
Given that the list of supported types is hardcoded in
LLVMContext::Data::toNativeType, this method is redundant because
LLVMPreparedFunction can create a ColumnVector itself.
2018-04-25 13:37:26 +03:00
pyos
5f1bf11ede Implement a loop over the columns in jit-compiled code 2018-04-25 13:37:25 +03:00
pyos
407008a4d9 Separate jit-compilability checks from actual compilation 2018-04-25 13:37:25 +03:00
pyos
e96a5e8344 Implement JIT compilation, without a loop for now.
It actually seems to work, so long as you only have one row that is. E.g.

    > select something(cast(number + 6 as Float64), cast(number + 2 as Float64)) from system.numbers limit 1';
    8

with this IR:

    define void @"something(CAST(plus(number, 6), 'Float64'), CAST(plus(number, 2), 'Float64'))"(void**, i8*, double*) {
    entry:
      %3 = load void*, void** %0
      %4 = bitcast void* %3 to double*
      %5 = load double, double* %4
      %6 = getelementptr void*, void** %0, i32 1
      %7 = load void*, void** %6
      %8 = bitcast void* %7 to double*
      %9 = load double, double* %8
      %10 = fadd double %5, %9
      store double %10, double* %2
      ret void
    }
2018-04-25 13:37:25 +03:00
pyos
851684de51 Add a JIT interface for row-wise default-nullable functions.
Not actually implemented, though. It does print out some jit-compiled stuff,
but that's about it. For example, this query:

    select number from system.numbers where something(cast(number as Float64)) == 4

results in this on server's stderr:

    define double @"something(CAST(number, 'Float64'))"(void**, i8*, void*) {
    "something(CAST(number, 'Float64'))":
      ret double 1.234500e+04
    }

(and an exception, because that's what the non-jitted method does.)

As one may notice, this function neither reads the input (first argument;
tuple of arrays) nor writes the output (third argument; array), instead
returning some general nonsense.

In addition, `#if USE_EMBEDDED_COMPILER` doesn't work for some reason,
including LLVM headers requires -Wno-unused-parameter, this probably only
works on LLVM 5.0 due to rampant API instability, and I'm definitely
no expert on CMake. In short, there's still a long way to go.
2018-04-25 13:37:25 +03:00