0001-Don-t-codegen-if-tuple-is-virtual-in-expr-eval-of-sc.patch
application/octet-stream
Filename: 0001-Don-t-codegen-if-tuple-is-virtual-in-expr-eval-of-sc.patch
Type: application/octet-stream
Part: 0
Patch
Format: format-patch
Series: patch 0001
Subject: Don't codegen if tuple is virtual in expr eval of scan fetch
| File | + | − |
|---|---|---|
| src/backend/jit/llvm/llvmjit_expr.c | 12 | 10 |
From 6756569021bd5b76f69a3d8d08ea60cc1e4d0ba5 Mon Sep 17 00:00:00 2001
From: soumyadeep2007 <sochakraborty@pivotal.io>
Date: Tue, 17 Sep 2019 09:21:48 -0700
Subject: [PATCH 1/2] Don't codegen if tuple is virtual in expr eval of scan
fetch
---
src/backend/jit/llvm/llvmjit_expr.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/src/backend/jit/llvm/llvmjit_expr.c b/src/backend/jit/llvm/llvmjit_expr.c
index 30133634c7..e159255627 100644
--- a/src/backend/jit/llvm/llvmjit_expr.c
+++ b/src/backend/jit/llvm/llvmjit_expr.c
@@ -278,14 +278,21 @@ llvm_compile_expr(ExprState *state)
LLVMValueRef l_jit_deform = NULL;
const TupleTableSlotOps *tts_ops = NULL;
- b_fetch = l_bb_before_v(opblocks[i + 1],
- "op.%d.fetch", i);
-
if (op->d.fetch.known_desc)
desc = op->d.fetch.known_desc;
if (op->d.fetch.fixed)
+ {
tts_ops = op->d.fetch.kind;
+ /*
+ * Deforming is not required if the tuple is virtual.
+ */
+ if (tts_ops && tts_ops == &TTSOpsVirtual)
+ {
+ LLVMBuildBr(b, opblocks[i + 1]);
+ break;
+ }
+ }
if (opcode == EEOP_INNER_FETCHSOME)
v_slot = v_innerslot;
@@ -294,13 +301,8 @@ llvm_compile_expr(ExprState *state)
else
v_slot = v_scanslot;
- /*
- * Check if all required attributes are available, or
- * whether deforming is required.
- *
- * TODO: skip nvalid check if slot is fixed and known to
- * be a virtual slot.
- */
+ b_fetch = l_bb_before_v(opblocks[i + 1],
+ "op.%d.fetch", i);
v_nvalid =
l_load_struct_gep(b, v_slot,
FIELDNO_TUPLETABLESLOT_NVALID,
--
2.23.0