|
| 1 | +diff --git a/src/backend/jit/llvm/llvmjit_deform.c b/src/backend/jit/llvm/llvmjit_deform.c |
| 2 | +index 6384ac940d8..8b4f731e7a8 100644 |
| 3 | +--- a/src/backend/jit/llvm/llvmjit_deform.c |
| 4 | ++++ b/src/backend/jit/llvm/llvmjit_deform.c |
| 5 | +@@ -104,6 +104,10 @@ slot_compile_deform(LLVMJitContext *context, TupleDesc desc, int natts) |
| 6 | + |
| 7 | + int attnum; |
| 8 | + |
| 9 | ++ /* don't generate code for tuples without user attributes */ |
| 10 | ++ if (desc->natts == 0) |
| 11 | ++ return NULL; |
| 12 | ++ |
| 13 | + mod = llvm_mutable_module(context); |
| 14 | + |
| 15 | + funcname = llvm_expand_funcname(context, "deform"); |
| 16 | +diff --git a/src/backend/jit/llvm/llvmjit_expr.c b/src/backend/jit/llvm/llvmjit_expr.c |
| 17 | +index 12138e49577..8638ebc4ba1 100644 |
| 18 | +--- a/src/backend/jit/llvm/llvmjit_expr.c |
| 19 | ++++ b/src/backend/jit/llvm/llvmjit_expr.c |
| 20 | +@@ -274,6 +274,7 @@ llvm_compile_expr(ExprState *state) |
| 21 | + LLVMValueRef v_slot; |
| 22 | + LLVMBasicBlockRef b_fetch; |
| 23 | + LLVMValueRef v_nvalid; |
| 24 | ++ LLVMValueRef l_jit_deform = NULL; |
| 25 | + |
| 26 | + b_fetch = l_bb_before_v(opblocks[i + 1], |
| 27 | + "op.%d.fetch", i); |
| 28 | +@@ -336,17 +337,20 @@ llvm_compile_expr(ExprState *state) |
| 29 | + */ |
| 30 | + if (desc && (context->base.flags & PGJIT_DEFORM)) |
| 31 | + { |
| 32 | +- LLVMValueRef params[1]; |
| 33 | +- LLVMValueRef l_jit_deform; |
| 34 | +- |
| 35 | + l_jit_deform = |
| 36 | +- slot_compile_deform(context, desc, |
| 37 | ++ slot_compile_deform(context, |
| 38 | ++ desc, |
| 39 | + op->d.fetch.last_var); |
| 40 | ++ } |
| 41 | ++ |
| 42 | ++ if (l_jit_deform) |
| 43 | ++ { |
| 44 | ++ LLVMValueRef params[1]; |
| 45 | ++ |
| 46 | + params[0] = v_slot; |
| 47 | + |
| 48 | + LLVMBuildCall(b, l_jit_deform, |
| 49 | + params, lengthof(params), ""); |
| 50 | +- |
| 51 | + } |
| 52 | + else |
| 53 | + { |
0 commit comments