1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-19 23:22:23 +03:00

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 <andres@anarazel.de>
Co-authored-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Andreas Karlsson <andreas@proxel.se>
Discussion: https://postgr.es/m/415721CE-7D2E-4B74-B5D9-1950083BA03E@yesql.se
Discussion: https://postgr.es/m/20191023163849.sosqbfs5yenocez3@alap3.anarazel.de
This commit is contained in:
Daniel Gustafsson
2025-03-11 12:02:38 +01:00
parent dabccf4513
commit 8dd7c7cd0a
7 changed files with 98 additions and 34 deletions

View File

@@ -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: