diff options
| author | Daniel Gustafsson | 2025-03-11 11:02:38 +0000 |
|---|---|---|
| committer | Daniel Gustafsson | 2025-03-11 11:02:38 +0000 |
| commit | 8dd7c7cd0a2605d5301266a6b67a569d6a305106 (patch) | |
| tree | 1da627dcaf9c5f7cc30de84292b2463858de8f58 /src/backend/jit | |
| parent | dabccf45139a8c7c3c2e7683a943c31077e55a78 (diff) | |
Replace EEOP_DONE with special steps for return/no return
Knowing when the side-effects of an expression is the intended result
of the execution, rather than the returnvalue, is important for being
able generate more efficient JITed code. This replaces EEOP_DONE with
two new steps: EEOP_DONE_RETURN and EEOP_DONE_NO_RETURN. Expressions
which return a value should use the former step; expressions used for
their side-effects which don't return value should use the latter.
Author: Andres Freund <[email protected]>
Co-authored-by: Daniel Gustafsson <[email protected]>
Reviewed-by: Andreas Karlsson <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/backend/jit')
| -rw-r--r-- | src/backend/jit/llvm/llvmjit_expr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/backend/jit/llvm/llvmjit_expr.c b/src/backend/jit/llvm/llvmjit_expr.c index f0f5c3bd49f..4080b01c17e 100644 --- a/src/backend/jit/llvm/llvmjit_expr.c +++ b/src/backend/jit/llvm/llvmjit_expr.c @@ -321,7 +321,7 @@ llvm_compile_expr(ExprState *state) switch (opcode) { - case EEOP_DONE: + case EEOP_DONE_RETURN: { LLVMValueRef v_tmpisnull; LLVMValueRef v_tmpvalue; @@ -335,6 +335,10 @@ llvm_compile_expr(ExprState *state) break; } + case EEOP_DONE_NO_RETURN: + LLVMBuildRet(b, l_sizet_const(0)); + break; + case EEOP_INNER_FETCHSOME: case EEOP_OUTER_FETCHSOME: case EEOP_SCAN_FETCHSOME: |
