aboutsummaryrefslogtreecommitdiff
path: root/src/backend/jit/llvm/llvmjit_expr.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2020-11-24 10:45:00 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2020-11-24 10:45:00 +0200
commit0a2bc5d61e713e3fe72438f020eea5fcc90b0f0b (patch)
tree8f630f828fa6bbfb5984f037118211cd68d8a50e /src/backend/jit/llvm/llvmjit_expr.c
parente522024bd8dd28a0f13dcccfd39170698f45c939 (diff)
downloadpostgresql-0a2bc5d61e713e3fe72438f020eea5fcc90b0f0b.tar.gz
postgresql-0a2bc5d61e713e3fe72438f020eea5fcc90b0f0b.zip
Move per-agg and per-trans duplicate finding to the planner.
This has the advantage that the cost estimates for aggregates can count the number of calls to transition and final functions correctly. Bump catalog version, because views can contain Aggrefs. Reviewed-by: Andres Freund Discussion: https://www.postgresql.org/message-id/b2e3536b-1dbc-8303-c97e-89cb0b4a9a48%40iki.fi
Diffstat (limited to 'src/backend/jit/llvm/llvmjit_expr.c')
-rw-r--r--src/backend/jit/llvm/llvmjit_expr.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/backend/jit/llvm/llvmjit_expr.c b/src/backend/jit/llvm/llvmjit_expr.c
index eb1dea658cb..f232397cabf 100644
--- a/src/backend/jit/llvm/llvmjit_expr.c
+++ b/src/backend/jit/llvm/llvmjit_expr.c
@@ -1849,20 +1849,11 @@ llvm_compile_expr(ExprState *state)
case EEOP_AGGREF:
{
- AggrefExprState *aggref = op->d.aggref.astate;
- LLVMValueRef v_aggnop;
LLVMValueRef v_aggno;
LLVMValueRef value,
isnull;
- /*
- * At this point aggref->aggno is not yet set (it's set up
- * in ExecInitAgg() after initializing the expression). So
- * load it from memory each time round.
- */
- v_aggnop = l_ptr_const(&aggref->aggno,
- l_ptr(LLVMInt32Type()));
- v_aggno = LLVMBuildLoad(b, v_aggnop, "v_aggno");
+ v_aggno = l_int32_const(op->d.aggref.aggno);
/* load agg value / null */
value = l_load_gep1(b, v_aggvalues, v_aggno, "aggvalue");