19 #include <llvm/IR/BasicBlock.h>
20 #include <llvm/IR/IRBuilder.h>
21 #include <llvm/IR/Value.h>
24 #include "../../Shared/sqldefs.h"
25 #include "../CgenState.h"
26 #include "../IRCodegenUtils.h"
66 const std::function<
JoinLoopDomain(
const std::vector<llvm::Value*>&)>&
67 iteration_domain_codegen,
68 const std::function<llvm::Value*(
const std::vector<llvm::Value*>&)>&
69 outer_condition_match,
70 const std::function<
void(llvm::Value*)>& found_outer_matches,
72 const std::function<llvm::Value*(
const std::vector<llvm::Value*>& prev_iters,
73 llvm::Value*)>& is_deleted,
74 const bool nested_loop_join =
false,
75 const std::string&
name =
"");
77 static llvm::BasicBlock*
codegen(
78 const std::vector<JoinLoop>& join_loops,
79 const std::function<llvm::BasicBlock*(
const std::vector<llvm::Value*>&)>&
81 llvm::Value* outer_iter,
82 llvm::BasicBlock* exit_bb,
93 const std::vector<llvm::Value*>& iterators,
94 llvm::Value* iteration_counter,
95 llvm::Value* have_more_inner_rows,
96 llvm::Value* found_an_outer_match_ptr,
97 llvm::Value* current_condition_match_ptr,
105 const std::function<JoinLoopDomain(const std::vector<llvm::Value*>&)>
109 const std::function<llvm::Value*(const std::vector<llvm::Value*>&)>
121 const std::function<llvm::Value*(const std::vector<llvm::Value*>& prev_iters,
llvm::Value * element_count
llvm::Value * values_buffer
std::function< llvm::BasicBlock *(llvm::BasicBlock *, llvm::BasicBlock *, const std::string &, llvm::Function *, CgenState *)> HoistedFiltersCallback
const std::function< llvm::Value *(const std::vector< llvm::Value * > &)> outer_condition_match_
const std::function< JoinLoopDomain(const std::vector< llvm::Value * > &)> iteration_domain_codegen_
const std::function< void(llvm::Value *)> found_outer_matches_
static llvm::BasicBlock * codegen(const std::vector< JoinLoop > &join_loops, const std::function< llvm::BasicBlock *(const std::vector< llvm::Value * > &)> &body_codegen, llvm::Value *outer_iter, llvm::BasicBlock *exit_bb, CgenState *cgen_state)
JoinLoopKind kind() const
llvm::Value * slot_lookup_result
llvm::Value * upper_bound
JoinLoop(const JoinLoopKind, const JoinType, const std::function< JoinLoopDomain(const std::vector< llvm::Value * > &)> &iteration_domain_codegen, const std::function< llvm::Value *(const std::vector< llvm::Value * > &)> &outer_condition_match, const std::function< void(llvm::Value *)> &found_outer_matches, const HoistedFiltersCallback &hoisted_filters, const std::function< llvm::Value *(const std::vector< llvm::Value * > &prev_iters, llvm::Value *)> &is_deleted, const bool nested_loop_join=false, const std::string &name="")
const std::function< llvm::Value *(const std::vector< llvm::Value * > &prev_iters, llvm::Value *)> is_deleted_
const bool nested_loop_join_
bool isNestedLoopJoin() const
const HoistedFiltersCallback hoisted_filters_
static std::pair< llvm::BasicBlock *, llvm::Value * > evaluateOuterJoinCondition(const JoinLoop &join_loop, const JoinLoopDomain &iteration_domain, const std::vector< llvm::Value * > &iterators, llvm::Value *iteration_counter, llvm::Value *have_more_inner_rows, llvm::Value *found_an_outer_match_ptr, llvm::Value *current_condition_match_ptr, CgenState *cgen_state)