summaryrefslogtreecommitdiff
path: root/src/backend/jit/llvm/llvmjit_deform.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2018-11-15 22:00:30 -0800
committerAndres Freund <andres@anarazel.de>2018-11-15 22:00:30 -0800
commit7ef04e4d2cb287e4e28b87f24b4b36ef4e07530b (patch)
treee878bcae3a3007b491525796a45f26b9b6655938 /src/backend/jit/llvm/llvmjit_deform.c
parent15d8f83128e15de97de61430d0b9569f5ebecc26 (diff)
Don't generate tuple deforming functions for virtual slots.
Virtual tuple table slots never need tuple deforming. Therefore, if we know at expression compilation time, that a certain slot will always be virtual, there's no need to create a tuple deforming routine for it. Author: Andres Freund Discussion: https://postgr.es/m/20181105210039.hh4vvi4vwoq5ba2q@alap3.anarazel.de
Diffstat (limited to 'src/backend/jit/llvm/llvmjit_deform.c')
-rw-r--r--src/backend/jit/llvm/llvmjit_deform.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/backend/jit/llvm/llvmjit_deform.c b/src/backend/jit/llvm/llvmjit_deform.c
index 59e38d2d955..938dfc73361 100644
--- a/src/backend/jit/llvm/llvmjit_deform.c
+++ b/src/backend/jit/llvm/llvmjit_deform.c
@@ -31,7 +31,8 @@
* Create a function that deforms a tuple of type desc up to natts columns.
*/
LLVMValueRef
-slot_compile_deform(LLVMJitContext *context, TupleDesc desc, int natts)
+slot_compile_deform(LLVMJitContext *context, TupleDesc desc,
+ const TupleTableSlotOps *ops, int natts)
{
char *funcname;
@@ -88,6 +89,10 @@ slot_compile_deform(LLVMJitContext *context, TupleDesc desc, int natts)
int attnum;
+ /* virtual tuples never need deforming, so don't generate code */
+ if (ops == &TTSOpsVirtual)
+ return NULL;
+
mod = llvm_mutable_module(context);
funcname = llvm_expand_funcname(context, "deform");