26 #include <llvm/ExecutionEngine/ExecutionEngine.h>
27 #include <llvm/IR/Module.h>
28 #include <llvm/IR/Value.h>
33 using FuncPtr = int32_t (*)(int8_t* this_buff,
34 const int8_t* that_buff,
35 const int32_t start_entry_index,
36 const int32_t end_entry_index,
37 const int32_t that_entry_count,
40 const void* serialized_varlen_buffer);
45 std::unique_ptr<llvm::Module>
module;
58 const std::vector<TargetInfo>& targets,
59 const std::vector<int64_t>& target_init_vals);
84 Value* this_targets_start_ptr,
85 Value* that_targets_start_ptr)
const;
99 const size_t target_logical_idx,
100 const size_t target_slot_idx,
101 const size_t init_agg_val_idx,
102 const size_t first_slot_idx_for_target,
103 Function* ir_reduce_one_entry)
const;
111 const size_t target_logical_idx,
112 const size_t target_slot_idx,
113 const int64_t init_val,
114 const int8_t chosen_bytes,
115 Function* ir_reduce_one_entry)
const;
120 const size_t target_logical_idx,
121 Function* ir_reduce_one_entry)
const;
125 const size_t target_logical_idx,
126 Function* ir_reduce_one_entry)
const;
129 const llvm::Function* ir_is_empty,
130 const llvm::Function* ir_reduce_one_entry,
131 const llvm::Function* ir_reduce_one_entry_idx,
150 const std::vector<TargetInfo>& targets,
151 const std::vector<int64_t>& target_init_vals)
std::unique_ptr< CgenState > cgen_state
void reduceOneSlot(Value *this_ptr1, Value *this_ptr2, Value *that_ptr1, Value *that_ptr2, const TargetInfo &target_info, const size_t target_logical_idx, const size_t target_slot_idx, const size_t init_agg_val_idx, const size_t first_slot_idx_for_target, Function *ir_reduce_one_entry) const
void reduceOneEntryNoCollisions(const ReductionCode &reduction_code) const
std::shared_ptr< CompilationContext > compilation_context
std::unique_ptr< Function > ir_reduce_loop
void reduceOneEntryBaselineIdx(const ReductionCode &reduction_code) const
void reduceLoop(const ReductionCode &reduction_code) const
llvm::Function * llvm_reduce_loop
void reduceOneEntryNoCollisionsIdx(const ReductionCode &reduction_code) const
bool hasKeylessHash() const
std::vector< std::string > CodeCacheKey
ReductionCode finalizeReductionCode(ReductionCode reduction_code, const llvm::Function *ir_is_empty, const llvm::Function *ir_reduce_one_entry, const llvm::Function *ir_reduce_one_entry_idx, const CodeCacheKey &key) const
std::string cacheKey() const
std::unique_ptr< Function > ir_reduce_one_entry
const std::vector< int64_t > target_init_vals_
void reduceOneAggregateSlot(Value *this_ptr1, Value *this_ptr2, Value *that_ptr1, Value *that_ptr2, const TargetInfo &target_info, const size_t target_logical_idx, const size_t target_slot_idx, const int64_t init_val, const int8_t chosen_bytes, Function *ir_reduce_one_entry) const
const QueryMemoryDescriptor & query_mem_desc_
int32_t(*)(int8_t *this_buff, const int8_t *that_buff, const int32_t start_entry_index, const int32_t end_entry_index, const int32_t that_entry_count, const void *this_qmd, const void *that_qmd, const void *serialized_varlen_buffer) FuncPtr
const QueryMemoryDescriptor query_mem_desc_
std::unique_ptr< Function > ir_is_empty
ResultSetReductionJIT(const QueryMemoryDescriptor &query_mem_desc, const std::vector< TargetInfo > &targets, const std::vector< int64_t > &target_init_vals)
virtual ~ResultSetReductionJIT()=default
void reduceOneCountDistinctSlot(Value *this_ptr1, Value *that_ptr1, const size_t target_logical_idx, Function *ir_reduce_one_entry) const
static std::mutex s_reduction_mutex
std::unique_ptr< Function > ir_reduce_one_entry_idx
void reduceOneEntryTargetsNoCollisions(Function *ir_reduce_one_entry, Value *this_targets_start_ptr, Value *that_targets_start_ptr) const
QueryDescriptionType getQueryDescriptionType() const
virtual ReductionCode codegen() const
static CodeCache s_code_cache
void reduceOneApproxMedianSlot(Value *this_ptr1, Value *that_ptr1, const size_t target_logical_idx, Function *ir_reduce_one_entry) const
virtual ReductionCode codegen() const
Descriptor for the result set buffer layout.
bool didOutputColumnar() const
void isEmpty(const ReductionCode &reduction_code) const
std::unique_ptr< llvm::Module > module
void reduceOneEntryBaseline(const ReductionCode &reduction_code) const
GpuReductionHelperJIT(const QueryMemoryDescriptor &query_mem_desc, const std::vector< TargetInfo > &targets, const std::vector< int64_t > &target_init_vals)
const std::vector< TargetInfo > targets_