From 0a2bc5d61e713e3fe72438f020eea5fcc90b0f0b Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Tue, 24 Nov 2020 10:45:00 +0200 Subject: 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 --- src/backend/jit/llvm/llvmjit_expr.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/backend/jit/llvm/llvmjit_expr.c') 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"); -- cgit v1.2.3