Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7ef04e4

Browse files
committed
Don't generate tuple deforming functions for virtual slots.
Virtual tuple table slots never need tuple deforming. Therefore, if weknow at expression compilation time, that a certain slot will alwaysbe virtual, there's no need to create a tuple deforming routine forit.Author: Andres FreundDiscussion:https://postgr.es/m/20181105210039.hh4vvi4vwoq5ba2q@alap3.anarazel.de
1 parent15d8f83 commit7ef04e4

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

‎src/backend/jit/llvm/llvmjit_deform.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
* Create a function that deforms a tuple of type desc up to natts columns.
3232
*/
3333
LLVMValueRef
34-
slot_compile_deform(LLVMJitContext*context,TupleDescdesc,intnatts)
34+
slot_compile_deform(LLVMJitContext*context,TupleDescdesc,
35+
constTupleTableSlotOps*ops,intnatts)
3536
{
3637
char*funcname;
3738

@@ -88,6 +89,10 @@ slot_compile_deform(LLVMJitContext *context, TupleDesc desc, int natts)
8889

8990
intattnum;
9091

92+
/* virtual tuples never need deforming, so don't generate code */
93+
if (ops==&TTSOpsVirtual)
94+
returnNULL;
95+
9196
mod=llvm_mutable_module(context);
9297

9398
funcname=llvm_expand_funcname(context,"deform");

‎src/backend/jit/llvm/llvmjit_expr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ llvm_compile_expr(ExprState *state)
324324
{
325325
l_jit_deform=
326326
slot_compile_deform(context,desc,
327+
tts_ops,
327328
op->d.fetch.last_var);
328329
}
329330

‎src/include/jit/llvmjit.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ extern void llvm_inline(LLVMModuleRef mod);
111111
****************************************************************************
112112
*/
113113
externboolllvm_compile_expr(structExprState*state);
114-
externLLVMValueRefslot_compile_deform(structLLVMJitContext*context,TupleDescdesc,intnatts);
114+
structTupleTableSlotOps;
115+
externLLVMValueRefslot_compile_deform(structLLVMJitContext*context,TupleDescdesc,
116+
conststructTupleTableSlotOps*ops,intnatts);
115117

116118
/*
117119
****************************************************************************

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp